Installation
Docker Engine
On the server behind corporate server, an easy way to install Docker fron package (PRM file).
-
Download the package files named docker-ce-<VERSION_STRING>, docker-ce-cli-<VERSION_STRING>, containerd.io
-
Install them with yum
$ sudo yum install /path/to/package.rpm
Docker Compose
- Run this command to download the current stable release of Docker Compose:
sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
To install a different version of Compose, substitute 1.27.4 with the version of Compose you want to use.
- Apply executable permissions to the binary:
sudo chmod +x /usr/local/bin/docker-compose
- Create a symbolic link to /usr/bin or any other directory in your path.
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
Proxy setup
On CentOS7 if docker is behind a proxy server then use following steps:
- Create folder for configuring docker service through systemd
mkdir /etc/systemd/system/docker.service.d
- Create service configuration file at
/etc/systemd/system/docker.service.d/http-proxy.conf
with the below content. ``` d [Service]
Environment=”HTTP_PROXY=http://YOUR-PROXY.SERVER:PORT/” Environment=”HTTPS_PROXY=http://YOUR-PROXY.SERVER:PORT/” Environment=”FTP_PROXY=http://YOUR-PROXY.SERVER:PORT/”
Environment=”NO_PROXY=localhost,127.0.0.0/8,10.0.0.0/8,192.168.0.0/16,172.16.0.0/12”
3. Reload systemctl so that new settings are read
``` bash
sudo systemctl daemon-reload
- Verify that docker service Environment is properly set
sudo systemctl show docker --property Environment
- Restart docker service so that it uses updated Environment settings
sudo systemctl restart docker