Docker: Installation on Ubuntu

Jika sebelumnya pernah install docker, pastikan sudah menghapusnya terlebh dahulu sudo apt-get remove docker docker-engine docker.io containerd runc

Instalasi menggunakan repository
Install repository dependency sudo apt-get update sudo apt-get install ca-certificates curl gnupg lsb-release

Add docker official GPG Key curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

Add repository 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

Update repository sudo apt update

Install docker sudo apt install docker-ce docker-ce-cli containerd.io

Verify docker installed sudo docker run hello-world

More: https://docs.docker.com/engine/install/ubuntu/