The NPM_TOKEN
environment variable (build argument) is generated by executing
npm login
and extracting the token from ~/.npmrc
.
See Deploying with npm private modules.
docker build -t [TAG] --build-arg NPM_TOKEN=00000000-0000-0000-0000-000000000000 .
# Or, with the token in a local environment variable...
export NPM_TOKEN=00000000-0000-0000-0000-000000000000
docker build -t [TAG] --build-arg NPM_TOKEN=$NPM_TOKEN .