Open antons1 opened 5 years ago
Somewhat relevant
Dockerfile
FROM ...
ENV MY_ENV
RUN something $MY_ENV
I just recently realized that MY_ENV=foo fargate service deploy app
doesn't pass the environment variable to the Docker during the build.
Any thoughts?
I am having problems creating a service behind the firewall at work.
Trying to run this command:
fargate service create <name> --region <region> --lb <loadbalancer> --port 443
, which in turn runsdocker build --rm=false --tag <tag> .
, I get toRUN apk update
in the docker file, which then fails withERROR: http://dl-cdn.alpinelinux.org/alpine/v3.9/main: network error (check Internet connection and firewall)
.This is because of the proxy that our company network sits behind. For some reason, docker does not pick up proxy env vars when running docker build, so even though
$HTTP_PROXY
and friends are all set up, this fails.A workaround is to add
--build-arg HTTP_PROXY=$http_proxy --build-arg HTTPS_PROXY=$https_proxy
to the docker command, so if I rundocker build --rm=false --tag <tag> . --build-arg HTTP_PROXY=$http_proxy --build-arg HTTPS_PROXY=$https_proxy
, everything works fine. This also currently works as a workaround, as the files will be cached, and subsequent builds withfargate
will run fine as docker does not try do actually download anything.See https://github.com/moby/moby/issues/24697 for discussion about this behaviour in Docker. Would it be possible to add an argument to the fargate cli that can be used to pass arguments to docker?