Berikut ini akan dijelaskan cara untuk menginstall Docker bukan Podman di Fedora 34.

1. Install plugin DNF

Pertama install plugin DNF dnf-plugins-core

sudo dnf -y install dnf-plugins-core

2. Tambahkan repository Docker dari docker.com

sudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo

3. Install Docker

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

Tambahkan user anda kedalam group docker, agar bisa menjalankan docker dengan user biasa

sudo usermod -aG docker $USER

pastikan user anda sudah masuk kedalam group docker

$ id jaranguda
uid=1000(jaranguda) gid=1000(jaranguda) groups=1000(jaranguda),10(wheel),973(vboxusers),970(docker)

Jalankan service docker

sudo systemctl enable --now docker

Coba jalankan perintah docker

docker pull alpine:latest

bila anda mendapati error

Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.24/images/create?fromImage=alpine&tag=latest: dial unix /var/run/docker.sock: connect: permission denied

Periksa permission socket docker

ls -l /var/run/docker.sock
# output 
srw-rw---- 1 root root 0 Jul  5 11:34 /var/run/docker.sock

karena kita baru menambahkan user kedalam group docker, perubahan tersebut belum terdeteksi. Reboot atau logoff lalu jalankan kembali perintah docker diatas.

Kita coba mendownload images dari Docker HUB, lalu menjalankan perintah sederhana

$ docker run -it  alpine:latest ping -c5  google.com
PING google.com (74.125.24.102): 56 data bytes
64 bytes from 74.125.24.102: seq=0 ttl=105 time=18.725 ms
64 bytes from 74.125.24.102: seq=1 ttl=105 time=17.621 ms
64 bytes from 74.125.24.102: seq=2 ttl=105 time=17.589 ms
64 bytes from 74.125.24.102: seq=3 ttl=105 time=17.359 ms
64 bytes from 74.125.24.102: seq=4 ttl=105 time=17.297 ms

Leave a comment

Your email address will not be published. Required fields are marked *