Child pages
  • Docker installation and configuration
Skip to end of metadata
Go to start of metadata

When researchers need to install dockers on a VM. Follow the steps below.

 

Prerequsite

Before getting started, make sure squid proxy has been properly set and VM can access Internet. In /etc/profile, add

export http_proxy=http://squid.auckland.ac.nz:3128
export https_proxy=http://squid.auckland.ac.nz:3128

Install Docker CE

RHEL

RHEL doesn't officially support docker CE. But it is still possible to install docker CE on it. The latest 17.06 has tricky dependency issues. It's recommended to use earlier 17.03 version.

Run the following script from rancher. 

curl https://releases.rancher.com/install-docker/17.03.sh | sh

Ubuntu

Run the following script from docker to get the latest docker.

curl https://get.docker.com | sh

Configure registry proxy

To enable docker pull behind the proxy, please refer to this article. In a short sentence, create a file /etc/systemd/system/docker.service.d/proxy.conf with the content

[Service]
Environment="HTTPS_PROXY=http://squid.auckland.ac.nz:3128" "HTTP_PROXY=http://squid.auckland.ac.nz:3128"

and verify the change by running the following commands.

systemctl daemon-reload
systemctl restart docker
systemctl show --property=Environment docker
docker run hello-world

Configure registry proxy

To allow apps inside a docker container to use the proxy server, in /etc/default/docker file, add the following line

export http_proxy="http://squid.auckland.ac.nz:3128/
export https_proxy=http://squid.auckland.ac.nz:3128/

Finally, reboot docker service.