ubuntu - Building a docker file with apt-get behind a proxy -
i'm trying run apt-get -y install python
while behind proxy shown in dockerfile below:
from ubuntu:16.04 run \ http_proxy=http://exampleproxy.com:80 \ apt-get -y update && \ http_proxy=http://exampleproxy.com:80 \ apt-get install -y python python-dev python-pip python-virtualenv run \ http_proxy=http://exampleproxy.com:80 \ rm -rf /var/lib/apt/lists/* run pip install --upgrade pip --proxy=http://emea-proxy.uk.oracle.com:80 add . /code workdir /code run pip install -r requirements.txt --proxy=http://exampleproxy.com:80 entrypoint ["python", "python_file.py"]
i have specify proxy twice in first run, because proxy doesn't carry on apt-get install
otherwise.
i can't use env
affects program (it runs/gets files within proxy , download incorrectly if specify proxies environment variables).
when try building file error:
unable fetch archives, maybe run apt-get update or try --fix-missing? command [...]returned non-zero code: 100
i have taken consideration docker layer caching , use --no-cache
while building image. apt-get update
should run every time.
thanks reading :)
Comments
Post a Comment