In this article after installing docker (How to install Docker on Linux) and configuring its service (Cannot connect to the Docker daemon at unix:var run docker.sock. Is the docker daemon running) next step is to download docker containers from docker hub (internet) for testing purpose.
My docker is setup properly and docker engine is running good, as I can see below.
I will try downloading simple and smallest docker image for testing with below command, (this require Internet connection as images will be downloaded from docker hub).
sudo docker run hello-world
As I don't have direct connection and proxy server is configured in .bashrc file for logged in user, I was receiving below error.
Unable to find image 'hello-world:latest' locally
docker: Error response from daemon: Get https://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker.io on 192.168.34.11:53: read udp 192.168.34.13:38062->192.168.34.11:53: i/o timeout.
See 'docker run --help'.
This is due to docker proxy need to be configured separately.
To configure docker proxy create a new folder /etc/systemd/system/docker.service.d and create a file http-proxy.conf inside it.
mkdir /etc/systemd/system/docker.service.d cat > /etc/systemd/system/docker.service.d/http-proxy.conf
Add below proxy information in the file replace <ip> to your proxy ips. (you uyse vi text editor as well)
[Service] Environment="HTTP_PROXY=<ip>:808" Environment="HTTPS_PROXY=<ip>:808" Environment="NO_PROXY=localhost,127.0.0.1,localaddress,.localdomain.com"
Once the file is configured reload docker daemon and restart docker service with systemctl.
sudo systemctl daemon-reload sudo systemctl restart docker
In the last try with downloading hello-world image container from docker hub (hello-world is smaller image to download), It will be successful with highlighted message as shown below. You can use docker ps -a check the container information.
sudo docker run hello-world
Useful Article
How to install Ansible on Linux for vSphere configuration
PART 1 : BUILDING AND BUYING GUIDE IDEAS FOR VMWARE LAB
PART 2 : BUILDING AND HARDWARE BUYING GUIDE IDEAS FOR VMWARE LAB
PART 3 : MY VSPHERE LAB CONFIGURATION ON VMWARE WORKSTATION