Closed vladholubiev closed 7 years ago
@vladgolubev did you end up solving this on your own?
@jshimko oh, it's been a while 😅
Yes, I was able to resolve this
I'd be happy to add this support to the project. I'd like it to be as flexible as possible. What did you end up doing?
I don't remember for what reason, it was long time ago, but I end-up using ulexus/meteor:v1.4-build
as a base image and writing npm tokens as RUN
commands in my Dockerfile
.
For this project, I think it makes sense to put
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
in scripts/build-meteor.sh somewhere before line 27
and add ONBUILD ARG NPM_TOKEN
somewhere in Dockerfile
alongside other build arguments.
so it could be used as
docker build \
--build-arg NPM_TOKEN="abcdef...." \
-t myorg/myapp:latest .
What happens if someone doesn't supply that arg? That npmrc is going to get created either way, no?
Yes, it will be created, without token, and that's fine, npm can handle it. Public dependencies will be installed anyway
Ok, great. Thanks for the details. I'll get it added in the next release.
this is not yet in, right?
@dbuezas @vladgolubev Private npm module support has been added today in v2.2.0. Sorry for the wait!
https://github.com/jshimko/meteor-launchpad#installing-private-npm-packages
For what it's worth, if you're logged in to npm already on your local machine, you can just do this to find your token...
cat ~/.npmrc
Or to parse it out...
cat ~/.npmrc | cut -d "=" -f 2
Or on a Mac, to parse it out and add to your clipboard...
cat ~/.npmrc | cut -d "=" -f 2 | pbcopy
Hey, looks like this is currently most active Meteor Docker image project!
But it misses support of private npm modules.
It's easy achievable with just two lines of code - https://docs.npmjs.com/private-modules/docker-and-private-modules
Custom npm registry also can be adjusted, but I doubt this feature is wanted enough.
Also not sure if node creates empty
.npmrc
after installation, so maybe we should write token somewhere afterinstall-node.sh
, something to look at.Anyway, thanks for putting your effort!