{"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://avatars3.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":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-04-08T15:16:36Z","updated_at":"2017-03-24T09:29:21Z","closed_at":"2016-04-08T16:03:01Z","body":"Hi I am a docker noob, so excuse me if this is a dumb question.\n\nI want to build a npm package on `dockerhub`, but my package have private dependencies.\n\nI try to authenticate by defining my NPM authToken as a build-time environment variable in my `Dockerfile`.\n\nI thought a line like this in my `Dockerfile` should work:\n`ARG  NPM_TOKEN=00000000-0000-0000-0000-000000000000`\nbut I get a 404 error.\n\nWill this strategy work, or is there another way for the build server to get access to my private repos?\n"},"comment":{"url":"https://api.github.com/repos/nodejs/docker-node/issues/comments/288973907","html_url":"https://github.com/nodejs/docker-node/issues/145#issuecomment-288973907","issue_url":"https://api.github.com/repos/nodejs/docker-node/issues/145","id":288973907,"user":{"login":"PuKoren","id":4202557,"avatar_url":"https://avatars2.githubusercontent.com/u/4202557?v=3","gravatar_id":"","url":"https://api.github.com/users/PuKoren","html_url":"https://github.com/PuKoren","followers_url":"https://api.github.com/users/PuKoren/followers","following_url":"https://api.github.com/users/PuKoren/following{/other_user}","gists_url":"https://api.github.com/users/PuKoren/gists{/gist_id}","starred_url":"https://api.github.com/users/PuKoren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PuKoren/subscriptions","organizations_url":"https://api.github.com/users/PuKoren/orgs","repos_url":"https://api.github.com/users/PuKoren/repos","events_url":"https://api.github.com/users/PuKoren/events{/privacy}","received_events_url":"https://api.github.com/users/PuKoren/received_events","type":"User","site_admin":false},"created_at":"2017-03-24T09:29:21Z","updated_at":"2017-03-24T09:29:21Z","body":"For the record (and because this issue have pretty good google indexation), you can achieve it safely using build-args in your CI system.\r\n\r\n**Build command**\r\n```sh\r\ndocker build --build-arg NPM_TOKEN={you token here} -t image:tag .\r\n```\r\n\r\n**Dockerfile**\r\n```dockerfile\r\nFROM node:7\r\nARG NPM_TOKEN\r\nRUN echo \"//registry.npmjs.org/:_authToken=$NPM_TOKEN\" > ~/.npmrc && \\\r\n  npm install\r\n```\r\n\r\nYou may still be interested @tuananh "}}
{"actor":{"display_login":"PuKoren"}}