When creating a new image my Dockerfile needs to call npm install. This needs to work behind a proxy as well. At this point the following Dockerfile code works:
# Set proxy server
ENV http_proxy http://myproxy.example
ENV https_proxy http://myproxy.example
# run NPM install
RUN npm install --production
I would however like that I can set the ENV variables the same as in the docker-machine I have set up with
docker-machine create \
-d virtualbox \
--engine-env HTTP_PROXY=http://myproxy.example \
--engine-env HTTPS_PROXY=http://myproxy.example \
dock
i.e. I would like that the npm install command uses these environment variables. This would make sure that images of this Dockerfile can be built in any environment that has proxy settings available.
I have already set the created machine as env with the command
docker-machine env --no-proxy dock