Panduan

CentOS

  1. Pasang repository resmi docker
# yum
sudo yum install -y yum-utils
sudo yum-config-manager \
    --add-repo \
    https://download.docker.com/linux/centos/docker-ce.repo

# dnf
sudo dnf -y install dnf-plugins-core
sudo dnf config-manager \
    --add-repo \
    https://download.docker.com/linux/centos/docker-ce.repo
  1. Pasang docker
# yum
sudo yum install -y docker-ce docker-ce-cli containerd.io

# dnf
sudo dnf install -y docker-ce docker-ce-cli containerd.io
  1. Enable dan jalankan servis
systemctl enable --now docker
  1. Verifikasi
docker info

Ubuntu

  1. Pasang repository resmi docker
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo \
  "deb [arch=amd64 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
  1. Pasang docker
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io
  1. Enable dan jalankan servis
systemctl enable --now docker
  1. Verifikasi
docker info

Referensi