Skip to main content

Installation

Docker Compose

The latest download: https://docs.docker.com/compose/install/

sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

# If you can't run the command, creating a symblic link as follows.
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose

docker-compose --version
ARM64 Linux
# Download: https://github.com/docker/compose/releases
sudo curl -L --fail https://github.com/docker/compose/releases/download/v2.2.3/docker-compose-linux-aarch64 -o /usr/local/bin/docker-compose
sudo chmod 0755 /usr/local/bin/docker-compose

Docker

Latest: https://docs.docker.com/engine/install/

Ubuntu 20.04)
sudo apt-get update
sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg \
    lsb-release
    
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
  
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
Debian 9)
$ sudo apt-get update

$ sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg-agent \
    software-properties-common

# Add Docker's GPG key
$ curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -

# Set up the repository
$ sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/debian \
   $(lsb_release -cs) \
   stable"

# Install Docker Engine
$ sudo apt-get update
$ sudo apt-get install docker-ce docker-ce-cli containerd.io

# Verify that Docker is installed correctly.
$ sudo docker run hello-world
RedHat 8)

RHEL 8 只有 IBM Z(s390x) 架構才有支援 Docker,如果是 x86_64 可以使用 CentOS 版本來安裝。

預設不支援 docker-ce 安裝,必須手動加上套件庫位址

系統更新 (需有訂閱並完成註冊 RHN)

dnf update

手動新增 docker-ce 套件庫位址

編輯 

或直接執行

dnf install -y yum-utils
dnf config-manager –add-repo https://download.docker.com/linux/centos/docker-ce.repo

更新 docker-ce 相依性套件

dnf update

移除不用的衝突套件

dnf remove podman buildah

安裝 docker-ce

dnf install docker-ce docker-ce-cli containerd.io