catthehacker / docker_images

Docker images
MIT License
212 stars 75 forks source link

How i can enable HTTP_PROXY in the docker container? #132

Open lanbugs opened 1 month ago

lanbugs commented 1 month ago

Hi,

I search for the most easiest way to enforce the docker container to use proxy servers to do git clone etc.

I tried to build a own container based on catthehacker/ubuntu:act-22.04 with the following config:

` FROM catthehacker/ubuntu:act-22.04

ENV http_proxy=http://10.10.10.10:3128 ENV https_proxy=http://10.10.10.10:3128

RUN git config --global http.proxy http://10.10.10.10:3128 RUN git config --global https.proxy http://10.10.10.10:3128

RUN npm config set proxy http://10.10.10.10:3128 RUN npm config set https-proxy http://10.10.10.10:3128 `

I build this machine and adviced my act runner to take my own machine. But still problems when he tries to clone any external actions.

If i start the new container with docker run ENV variables present and git clone etc. works perfectly, i don`t know where i am turned wrong at the moment.

Thanks & Greetings

Max

ngarafol commented 1 month ago

Did you verify in your containers if proxy is visible in env? e.g. exec into running container or run it, and do printenv |grep proxy

Also take a look at this, looks pretty easy https://stackoverflow.com/a/30252882