Docker Installation On A Debian, Ubuntu, Alpine, Arch, Kali, CentOS, Fedora, Raspbian And MacOS
Install docker
-
Debian
apt-get install docker
Click to copy -
Ubuntu
apt-get install docker
Click to copy -
Alpine OS
apk add docker
Click to copy -
Arch Linux
pacman -S docker
Click to copy -
Kali Linux
apt-get install docker.io
Click to copy -
CentOS
yum install docker.io
Click to copy -
Fedora
dnf install docker.io
Click to copy -
Raspbian
apt-get install docker.io
Click to copy -
macOS
brew install docker
Click to copy
Manage Docker containers and images.
How to use docker?
Below are few example commands for docker that you can use in the terminal.
List currently running docker containers:docker ps
Click to copyList all docker containers (running and stopped):docker ps -a
Click to copyStart a container from an image, with a custom name:docker run --name container_name image
Click to copyStart or stop an existing container:docker start|stop container_name
Click to copyPull an image from a docker registry:docker pull image
Click to copyOpen a shell inside of an already running container:docker exec -it container_name sh
Click to copyRemove a stopped container:docker rm container_name
Click to copyFetch and follow the logs of a container:docker logs -f container_name
Click to copy
Install the latest version of docker in Debian, Ubuntu, Alpine, Arch, Kali, CentOS, Fedora, Raspbian and macOS from terminal. To install the docker just copy the above command for your OS and run into terminal. After you run the command it will grab the latest version of docker from the respository and install it in your computer/server.