Build environment variables

builder

#1

Hi!

I wanted to ask whether you plan on adding build environment variables that can be accessed during the build of the docker image.

We are using private npm modules and need to specify our NPM_TOKEN during build time when node_modules are installing. Currently node_modules are installed in the Dockerfile and it would probably make sense to keep it this way since they don’t change on application restart.

Kind regards,
Peter.


#2

Hey @peterjuras

Currently we do not have build time arguments, but we do have plans to support them. With the multicontainer update you will be able to specify build time arguments in your docker-compose.yml file. Unfortunately I would not recommend this for items such as tokens and api keys, but how build time arguments which are not specified in the docker compose file look in relation to the rest of our infrastructure has not yet been decided.

Rest assured that this is something that we have on our radar and will be tackled.

Other options such as resin deploy would allow you to specify build time arguments and deploy the image from local. Information on that can be found here.

Cameron