RUN npm config set registry $AUTH_TOKEN & \Īpk update & apk add yarn python g++ make & rm -rf /var/cache/apk/* & \ For example: FROM keymetrics/pm2:latest-alpine Try using & \ at the end of your commands and then placing the next command on a new line without the RUN bit. This causes a new image layer to be created for every single command and can bloat the size of your container massively. On a side note, you might want to consider not using multiple RUN commands one after another. This is how we setup auth tokens for npm for the most part. This will cause your docker user to then authenticate using that token against the registry defined. You could try writing the ~/.npmrc file rather than using the config set, this would just be a case of using: RUN echo -e "//private.repo/:_authToken=. I'm guessing the package is your private package? If so, it would seem your auth token either isn't being used or doesn't have access to that package for some reason.
RUN npm install apk update & apk add yarn python g++ make & rm -rf /var/cache/apk/*ĬMD Īnd the error log is: 11 verbose stack at tr圜atcher (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)ġ1 verbose stack at Promise._settlePromiseFromHandler (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:512:31)ġ1 verbose stack at Promise._settlePromise (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:569:18)ġ1 verbose stack at Promise._settlePromise0 (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)ġ1 verbose stack at Promise._settlePromises (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:693:18)ġ1 verbose stack at Async._drainQueue (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:133:16)ġ1 verbose stack at Async._drainQueues (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:143:10)ġ1 verbose stack at (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:17:14)ġ1 verbose stack at runCallback (timers.js:794:20)ġ1 verbose stack at tryOnImmediate (timers.js:752:5)ġ1 verbose stack at processImmediate (timers.js:729:5) Npm ERR! /root/.npm/_logs/T10_55_25_752Z-debug.logĪnd my Dockerfile is: FROM keymetrics/pm2:latest-alpine Any environment configurations that are not given a value will be given the value of true. For example, putting npmconfigfoobar in your environment will set the foo configuration parameter to bar. Npm ERR! 403 Forbidden: ERR! A complete log of this run can be found in: Any environment variables that start with npmconfig will be interpreted as a configuration parameter.
I created the authentication token and tried it but I am getting error at the line RUN npm install npm ERR! code E403 And our application uses the npm package of the private repo.
We have a private npm repo hosted using sinopia it has basic auth credentials.