Hi all!
We are trying to use a scoped private npm package in our docker build and are running into issues because the builder can’t find the packages. Any idea how to add permissions to the builder to enable this to work?
@namespace/package
More info on private packages
Thanks!
AJ
We’ve got a couple of options here, one done and one in the works
- You could build the image locally and then harness Resin to get that to the fleet using
resin deploy
https://docs.resin.io/reference/cli/#deploy-appname-image-
- We’re working on build-time secrets that would allow our builders to access private resources without those secrets being available to the fleet.
Okay we’re working on the first option, is there any update on the second?
Hi,
We are still working on adding support for build-time secrets on our platform. We will get back to you as soon as this gets released.
Hey @thgreasi,
Could this work?
https://docs.npmjs.com/private-modules/docker-and-private-modules
I’m getting the following error:
[main] The command '/bin/sh -c JOBS=MAX npm install --production --unsafe-perm && npm cache clean && rm -rf /tmp/*' returned a non-zero code: 7
[Info] Uploading images
[Success] Successfully uploaded images
[Error] Some services failed to build:
[Error] Service: main
[Error] Error: The command '/bin/sh -c JOBS=MAX npm install --production --unsafe-perm && npm cache clean && rm -rf /tmp/*' returned a non-zero code: 7
[Error] Not deploying release.
Actually getting this error first:
[main] Error: Failed to replace env in config: ${NPM_TOKEN}
[main] /usr/local/lib/node_modules/npm/lib/npm.js:43
Hi @alexcastillo,
The issue is that we currently don’t provide a mechanism that would allow you to pass the value for that variable to our builders.
Setting the key directly in your project’s .npmrc
would work, but you would also have to consider whether it is fine by your policy to commit and push such keys.
That’s where resin deploy
can be used to generate a build on your machine, so that your keys don’t have to be committed or pushed.
Let us know if this approach works for you.
Thodoris
Understood, thanks @thgreasi.
Hey @thgreasi, any updates?
Hey @alexcastillo,
We are currently testing this internally and are fine tuning some bits. We will get back to you as soon as this gets released.
Hey @thgreasi, any updates?
Hi,
That’s a high priority for us at the moment and working to get this done but it’s not ready yet. We will give you a note once that’s ready.
very good - thank you very much ! I’ll have a look into this possibility !