Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Allow passing arguments to docker #88

Open
antons1 opened this issue May 23, 2019 · 1 comment
Open

Allow passing arguments to docker #88

antons1 opened this issue May 23, 2019 · 1 comment

Comments

@antons1
Copy link

antons1 commented May 23, 2019

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 runs docker build --rm=false --tag <tag> ., I get to RUN apk update in the docker file, which then fails with ERROR: 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 run docker 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 with fargate will run fine as docker does not try do actually download anything.

See moby/moby#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?

@Mihailoff
Copy link

Mihailoff commented Feb 24, 2020

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?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants