Docker

Docker – Add Proxy to Docker Daemon

I am gonna cut the chatter and hit the platter.

Proxy Recommendation :-  To Download the image from hub, we need internet connectivity.

I’ma show you the Steps to configure the proxy for Docker daemon.

  1. Check the OS in which the docker-ce or docker-ee is installed.

ubuntu@docker:~$ cat /etc/*release*
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION=”Ubuntu 16.04.3 LTS”
NAME=”Ubuntu”
VERSION=”16.04.3 LTS (Xenial Xerus)”
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME=”Ubuntu 16.04.3 LTS”
VERSION_ID=”16.04″
HOME_URL=”http://www.ubuntu.com/”
SUPPORT_URL=”http://help.ubuntu.com/”
BUG_REPORT_URL=”http://bugs.launchpad.net/ubuntu/”
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial

2. Check the Docker version

ubuntu@docker:~$ sudo docker -v
Docker version 17.05.0-ce, build 89658be

3. Create a directory

sudo mkdir -p /etc/systemd/system/docker.service.d

4. Create a Proxy Conf

vim /etc/systemd/system/docker.service.d/http-proxy.conf

[Service]
Environment=”HTTP_PROXY=http://<proxy–ip>:<port>/”

Environment=”HTTPS_PROXY=https://<proxy–ip>:<port>/”

5. Now try to login to docker

ubuntu@docker:~$ sudo docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don’t have a Docker ID, head over to https://hub.docker.com to create one.
Username: <username>
Password:
Login Succeeded
ubuntu@docker:~$

 

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s