{"action":"created","issue":{"url":"https://api.github.com/repos/nodejs/docker-node/issues/145","repository_url":"https://api.github.com/repos/nodejs/docker-node","labels_url":"https://api.github.com/repos/nodejs/docker-node/issues/145/labels{/name}","comments_url":"https://api.github.com/repos/nodejs/docker-node/issues/145/comments","events_url":"https://api.github.com/repos/nodejs/docker-node/issues/145/events","html_url":"https://github.com/nodejs/docker-node/issues/145","id":146956905,"number":145,"title":"access npm private packages on dockerhub","user":{"login":"tjaartvdwalt","id":2066766,"avatar_url":"https://avatars.githubusercontent.com/u/2066766?v=3","gravatar_id":"","url":"https://api.github.com/users/tjaartvdwalt","html_url":"https://github.com/tjaartvdwalt","followers_url":"https://api.github.com/users/tjaartvdwalt/followers","following_url":"https://api.github.com/users/tjaartvdwalt/following{/other_user}","gists_url":"https://api.github.com/users/tjaartvdwalt/gists{/gist_id}","starred_url":"https://api.github.com/users/tjaartvdwalt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tjaartvdwalt/subscriptions","organizations_url":"https://api.github.com/users/tjaartvdwalt/orgs","repos_url":"https://api.github.com/users/tjaartvdwalt/repos","events_url":"https://api.github.com/users/tjaartvdwalt/events{/privacy}","received_events_url":"https://api.github.com/users/tjaartvdwalt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-08T15:16:36Z","updated_at":"2016-04-08T15:47:30Z","closed_at":null,"body":"Hi I am a docker noob, so excuse me if this is a dumb question.\r\n\r\nI want to build a npm package on `dockerhub`, but my package have private dependencies.\r\n\r\nI try to authenticate by defining my NPM authToken as a build-time environment variable in my `Dockerfile`.\r\n\r\nI thought a line like this in my `Dockerfile` should work:\r\n`ARG  NPM_TOKEN=00000000-0000-0000-0000-000000000000`\r\nbut I get a 404 error.\r\n\r\nWill this strategy work, or is there another way for the build server to get access to my private repos?"},"comment":{"url":"https://api.github.com/repos/nodejs/docker-node/issues/comments/207488715","html_url":"https://github.com/nodejs/docker-node/issues/145#issuecomment-207488715","issue_url":"https://api.github.com/repos/nodejs/docker-node/issues/145","id":207488715,"user":{"login":"Starefossen","id":968267,"avatar_url":"https://avatars.githubusercontent.com/u/968267?v=3","gravatar_id":"","url":"https://api.github.com/users/Starefossen","html_url":"https://github.com/Starefossen","followers_url":"https://api.github.com/users/Starefossen/followers","following_url":"https://api.github.com/users/Starefossen/following{/other_user}","gists_url":"https://api.github.com/users/Starefossen/gists{/gist_id}","starred_url":"https://api.github.com/users/Starefossen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Starefossen/subscriptions","organizations_url":"https://api.github.com/users/Starefossen/orgs","repos_url":"https://api.github.com/users/Starefossen/repos","events_url":"https://api.github.com/users/Starefossen/events{/privacy}","received_events_url":"https://api.github.com/users/Starefossen/received_events","type":"User","site_admin":false},"created_at":"2016-04-08T15:47:30Z","updated_at":"2016-04-08T15:47:30Z","body":"Setting the `NPM_TOKEN` environment is not possible to authenticate with npm. See npm/npm#8356 for a more detailed description of the issue.\r\n\r\nWhat you can do instead is the following:\r\n\r\n```Dockerfile\r\nFROM node:argon\r\n\r\nENV NPM_TOKEN \"00000000-0000-0000-0000-000000000000\"\r\n\r\nRUN echo \"//registry.npmjs.org/:_authToken=${NPM_TOKEN}\" > ~/.npmrc\r\nRUN npm install\r\n\r\nCMD ['node' 'index.js'] \r\n```"}}