Docker image pull
#Using Docker scaffolding, skip the following usage
# npm install --global verdaccio
docker pull verdaccio/verdaccio
mkdir -p ~/docker/verdaccio
cd ~/docker/verdaccio
git clone https://github.com/verdaccio/docker-examples
cd ~/docker/verdaccio/docker-examples
mv docker-local-storage-volume ~/docker/verdaccio
rm -rf ~/docker/verdaccio/docker-examples
chown -R 10001:65533 ~/docker/verdaccio
Copy the code
Editing a Configuration Filevim docker/verdaccio/conf/config.yaml
# path to a directory with all packagesstorage: .. /storage auth: htpasswd: file: ./htpasswd # Maximum amount of users allowed to register, defaults to "+inf". # You can set this to -1 to disable registration. max_users: 1000 uplinks: npmjs: #url: Listen: https://registry.npmjs.org/ url: https://registry.npm.taobao.org/ 0.0.0.0:4873Copy the code
Start the image and configure NPM
docker run --name verdaccio -itd -v ~/docker/verdaccio:/verdaccio -p 4873:4873 verdaccio/verdaccio
#Open http://localhost:4873 authenticationNPM set Registry http://localhost:4873/ NPM install -g NRM NRM ls NRM add verdaccio http://127.0.0.1:4873# nrm del verdaccio
nrm use verdaccio
npm adduser --registry http://localhost:4873
npm publish --registry http://localhost:4873
npm unpublish <package-name> --force
npm unpublish --force [packageName@version]
Copy the code
The test release
mkdir ~/test
cd ~/test
npm init -y
npm publish
Copy the code