How to use local proxy settings in docker-compose

后端 未结 2 1137

I am setting up a new server for our Redmine installation, since the old installation was done by hand, which makes it difficult to update everything properly. I decided to

2条回答
  •  自闭症患者
    2020-12-30 06:32

    For the proxy server which requires username and password for authentication: Apart from adding the credentials in /etc/systemd/system/docker.service.d/http-proxy.conf, as suggested in this answer, I also had to add the same to the Dockerfile. Following is a snippet from the Dockerfile.

    FROM ubuntu:16.04
    
    ENV http_proxy http://username:password@proxy_url:proxy_port
    ENV https_proxy http://username:password@proxy_url:proxy_port
    
    RUN apt-get update \
        && apt-get upgrade -y \
        && apt-get install -y \
        build-essential \
        bla bla bla ...
    

提交回复
热议问题