Skip to main content

Docker

Install Docker​

  1. Download the Docker installation package

    wget https://pdpublic.mingdao.com/private-deployment/offline/common/docker-29.9.3.tgz
  2. Extract the Docker installation package

    tar -zxvf docker-29.9.3.tgz
  3. Move the files to the binary directory

    mv -f docker/* /usr/local/bin/
  4. Create the Docker configuration directory

    mkdir -p /etc/docker/
  5. Create the Docker configuration file

    The default Docker data directory is /data/docker. To change it, modify the data-root value in daemon.json.

    cat > /etc/docker/daemon.json <<EOF
    {
    "registry-mirrors": ["https://uvlkeb6d.mirror.aliyuncs.com"],
    "data-root": "/data/docker",
    "max-concurrent-downloads": 10,
    "default-ulimits": {
    "nofile": {
    "Name": "nofile",
    "Soft": 102400,
    "Hard": 102400
    }
    },
    "exec-opts": ["native.cgroupdriver=cgroupfs"],
    "storage-driver": "overlay2",
    "default-address-pools":[{"base":"172.80.0.0/16","size":24}],
    "log-driver": "json-file",
    "log-opts": {
    "max-size": "1g",
    "max-file": "5"
    }
    }
    EOF
  6. Configure systemd to manage Docker

    cat > /etc/systemd/system/docker.service <<EOF
    [Unit]
    Description=Docker
    After=network-online.target
    Wants=network-online.target
    [Service]
    Type=notify
    ExecStart=/usr/local/bin/dockerd
    ExecReload=/bin/kill -s HUP \$MAINPID
    LimitNOFILE=102400
    LimitNPROC=infinity
    LimitCORE=0
    TimeoutStartSec=0
    Delegate=yes
    KillMode=process
    Restart=on-failure
    StartLimitBurst=3
    StartLimitInterval=60s
    [Install]
    WantedBy=multi-user.target
    EOF
  7. Start Docker

    systemctl daemon-reload
    systemctl start docker
    systemctl enable docker

Install Docker Compose​

  1. Download Docker Compose

    wget https://pdpublic.mingdao.com/private-deployment/offline/common/docker-compose-linux-x86_64
  2. Create the Docker CLI plugin directory

    mkdir -p /usr/local/lib/docker/cli-plugins
  3. Move the file to the plugin directory

    mv docker-compose-linux-x86_64 /usr/local/lib/docker/cli-plugins/docker-compose
  4. Grant execute permission

    chmod +x /usr/local/lib/docker/cli-plugins/docker-compose
  5. Create a symbolic link for compatibility with the legacy docker-compose command

    ln -s /usr/local/lib/docker/cli-plugins/docker-compose /usr/local/bin/docker-compose
  6. Verify the installation

    docker compose version
    docker-compose version