Docker setup note

Docker Daemon

Installation

Configuration

Proxy Configuration

mkdir -p /etc/systemd/system/docker.service.d
vim /etc/systemd/system/docker.service.d/http-proxy.conf
[Service]
EnvironmentFile=/etc/environment

Daemon Configuration

vim /etc/docker/daemon.json
{
  "log-driver": "json-file",
  "log-opts": {
    "max-size": "100m"
  },
  "registry-mirrors": ["http://DOCKER_REGISTRY_MIRROR/"],
  "insecure-registries": ["http://DOCKER_REGISTRY_MIRROR/"]
}
See:

Client configuration

mkdir -p /root/.docker
vim /root/.docker/config.json
{
  "proxies": {
    "default": {
      "httpProxy": "http://HOST:PORT",
      "httpsProxy": "http://HOST:PORT",
      "ftpProxy": "http://HOST:PORT",
      "noProxy": "NO_PROXY_HOSTS"
    }
  }
}
See:

Reload & Restart

systemctl daemon-reload
systemctl restart docker

Docker Compose