Tutorial Docker: Instalasi Docker CE (Server & Desktop)
Dedicated Author of LUKMANLAB
Artikel ini akan memberikan anda tutorial instalasi Docker CE (Community Edition) di Linux Ubuntu. Tutorial instalasi Docker ini tidak hanya fokus pada sistem operasi server, artikel ini juga memberikan panduan untuk sistem operasi desktop (client).

Docker CE
Sebelum masuk pada langkah-langkah instalasi sebaiknya dilengkapi dulu persyaratan berikut, untuk kelancaran instalasi:
Linux (Ubuntu)
- Cosmic 18.10
- Bionic 18.04 (LTS) - (Server/Desktop)
- Xenial 16.04 (LTS) - (Server/Desktop)
Spesifikasi RAM yang diminta oleh Docker ketika disetup pada sistem operasi linux tidak didokumentasikan. Namun, saya sudah menguji di RAM 2 GB dan 2 Core Processor berjalan normal, lebih kecil dari itu belum mencoba. :D
Akan membutuhkan penambahan memory jika anda menjalankan beberapa container banyak atau menjalankan container services yang berat, seperti: GitLab dsb.
Langkah-langkah Instalasi Docker CE via Repository
Instalasi pada server maupun desktop tidak ada perbedaan, karena script instalasi yang ada pada dokumentasi docker menyesuaikan rilis linux dan arch yang kita gunakan. Jadi script berikut anda pakai di server maupun di deskop harunya no issue. :D
Rekomendasi dari Docker sendiri, kita sebaiknya instal via Repository bukan menggunakan Deb ataupun Source.
LukmanLAB
Jika anda ingin instalasi secara otomatis bisa menggunakan script bash instalasi docker berikut:
$ curl -O https://raw.githubusercontent.com/lukmanlab/bash-script/master/docker-installation/script.sh
$ chmod +x script.sh
$ ./script.sh
1. Update Linux
$ sudo apt update
2. Instalasi Paket apt over HTTPS
$ sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
3. Menambahkan Official Docker GPG Key
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
4. Menambahkan Repository Docker
$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
5. Update & Instal Docker CE
$ sudo apt-get update && sudo apt-get install docker-ce docker-ce-cli containerd.io
6. Pastikan Services Docker Running
$ sudo systemctl status docker
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: active (running) since Jum 2019-05-17 08:02:56 WIB; 2h 31min ago
Docs: https://docs.docker.com
Main PID: 1914 (dockerd)
Tasks: 15
Memory: 94.3M
CPU: 4.925s
CGroup: /system.slice/docker.service
└─1914 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
7. Tambahkan User biasa ke Group Docker
Hal ini perlu kita eksekusi untuk kenyamanan menggunakan command docker tanpa perlu sudo.
$ sudo usermod -aG docker usermu
Testing: Silahkan coba untuk Run Hello World Container:
$ docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
1b930d010525: Pull complete
Digest: sha256:6f744a2005b12a704d2608d8070a494ad1145636eeb74a570c56b94d94ccdbfc
Status: Downloaded newer image for hello-world:latest
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(amd64)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/
For more examples and ideas, visit:
https://docs.docker.com/get-started/
Selamat mencoba...