Okay, to use Docker, we must first install Docker Community Edition (Docker CE). And to install Docker CE, the minimum OS that must be installed is:
And don't forget, it must be the 64bit version.
Install Through Repository
For how to install Docker CE there are three ways. First, we installed the Docker CE repository first on Ubuntu. Install several dependencies firstsudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
Then install the Docker CE repository
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
For archives, Docker CE supports amd64, armhf, arm64, s390x, and ppc64le architectures. You can choose according to taste.
Next is the installation process.
sudo apt-get update && sudo apt-get install docker-ce docker-ce-cli containerd.io
To verify that the CE Docker has been installed, we can try running the hello-world image.
sudo docker run hello-world
Install from Package
We immediately download the .deb package that is available on the Docker official website. For the list, you can check here <link>
For example, here I use Ubuntu 18.04. We just created a folder to download all the packages that will be installed. This is optional, just for convenience.
mkdir docker-install
cd docker install
Next, we download the package.
wget https://download.docker.com/linux/ubuntu/dists/bionic/pool/stable/amd64/containerd.io_1.2.5-1_amd64.deb
wget https://download.docker.com/linux/ubuntu/dists/bionic/pool/stable/amd64/docker-ce-cli_18.09.6~3-0~ubuntu-bionic_amd64.deb
wget https://download.docker.com/linux/ubuntu/dists/bionic/pool/stable/amd64/docker-ce_18.09.6~3-0~ubuntu-bionic_amd64.deb
Then we install with the command
sudo dpkg -i *.deb
Wait for the installation process to complete.
Install Using the Installer Script
Or the third way, the most simple, is to use the installer script.
curl -fsSL https://get.docker.com -o get-docker.sh sudo sh get-docker.sh
And follow the next step to complete.
How to Install Docker Image
Okay, above is the docker installation process. Well, what if we want to install a docker image. For example, I want to install Kali-Linux image on my Ubuntu system.
First, we search image times Linux.
sudo docker search kali
Next we do a pull request.
sudo docker pull kalilinux/kali-linux-docker
To see a list of installed docker images, use the command
sudo docker images
Well, to run one of the docker images, use the following command
sudo docker run -i -t kalilinux/kali-linux-docker /bin/bash
Remove Docker Image
To delete one of the docker images installed on the system, we first check the image id with the command
sudo docker images
For example, here the IMAGE ID for Kali-Linux is f26f3ae90aee. The remove command is
docker stop $(docker ps -a -q)
sudo docker rmi f26f3ae90aee
The first command is to stop the container process running, while the second command to delete the docker image. For IMAGE ID, please adjust it yourself with the IMAGE ID that you want to delete.
Uninstall Docker
If you feel you no longer need Docker, you can delete it with the following command.
sudo apt-get purge docker-ce sudo rm -rf /var/lib/docker sudo apt-get autoremove
Okay, thanks for reading this tutorial. And it just adds that I made this tutorial by utilizing VPS. Yes, I installed Docker CE on Digitalocean VPS. So for those of you who ask "Can you install docker on VPS", then the answer can be. And the installation process is the same as the installation process on the Linux desktop.
Source: LinuxSec
Post a Comment
Post a Comment
Mohon berkomentar sesuai topik artikel. Komentar dengan bahasa kasar, spam akan dihapus