Skip to content

Commit

Permalink
Improve method to build Dockerfile with a proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
uggla committed May 14, 2018
1 parent e3bd06c commit 0868892
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,14 @@ export https_proxy=http://<proxy name or ip>:<proxy port>
```

4. Configure Docker daemon to use the proxy as explained by this document: https://docs.docker.com/engine/admin/systemd/#http-proxy (in short add Environment="HTTP_PROXY=http://proxy.example.com:80/" "HTTPS_PROXY=http://proxy.example.com:80/" to your [services] section)
5. **Set the proxy in each of your Dockerfiles** by adding following text as the 2nd and 3rd line of the Dockerfile.
5. Build Dockerfile with the appropriate arguments.

```
ENV http_proxy <HTTP_PROXY>
ENV https_proxy <HTTP_PROXY>
docker build --build-arg http_proxy=http://<proxy name or ip>:<proxy port> https_proxy=http://<proxy name or ip>:<proxy port> .
```

Documentation details :
https://docs.docker.com/engine/reference/builder/#arg

## Docker installation
Docker is available externally from http://docs.docker.com/linux/step_one/ or using your distribution packages, or from github at https://github.com/docker/docker
Expand Down

0 comments on commit 0868892

Please sign in to comment.