Docker is container-based application framework, which wrap of a specific application with all its dependencies in a container. Docker containers can easily ship to a remote location on start there without making the entire application setup. This tutorial will help you to install Docker on Fedora 34/33/32/31/30 operating systems.
Step 1 – Prerequisites
For the standard installation, Docker required a 64-bit operating system having Kernel >= 3.10 version. Older versions of Kernel have some missing requirements to run all features of Docker.
uname -r 4.16.5-300.fc28.x86_64
Step 2 – Enable DNF Repository
Let’s add the official Docker yum repository to your system. Also, update the package’s metadata cache.
sudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo sudo dnf makecache
Step 3 – Install Docker on Fedora
Now install the docker community edition package to install docker on your system. This is installed in many of the required decencies on your system.
sudo dnf install docker-ce
After successful installation of the Docker engine, Let’s enable and start the docker service.
sudo systemctl enable docker.service sudo systemctl start docker.service
Then check the status of the Docker service.
Docker has been installed and running on your system. You can visit our Docker tutorial section to work with Docker containers.
How to Use Docker?
Search Docker Images
First of all search Docker container images from the Docker hub. For example, the below command will search all images with Fedora and list them as output
sudo docker search fedora
Download Docker Images
Now download the Docker container with the name Ubuntu on your local system using the following commands.
sudo docker pull fedora Using default tag: latest latest: Pulling from library/fedora 0be2a68855d7: Extracting [==============================> ] 69.63MB/89.87MB
Now make sure that above images have been downloaded successfully on your system. Below command list all images.
sudo docker images REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE ubuntu latest 36248ae4a9ac 2 days ago 188 MB fedora latest 26ffec5b4a8a 2 weeks ago 275MB
Launch New Container with Image
Finally, launch a Docker container using the above-downloaded image on your system. Below command will start a new container.
sudo docker run -i -t -d fedora /bin/bash
To view all running containers type
sudo docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 695efa2ace69 fedora "/bin/bash" 58 seconds ago Up 56 seconds first_fedora
By default Above command will list only running containers. To list all containers (including stopped containers) use the following command.
docker ps -a
You can start, stop or attach to any containers with following commands. To start container use following command.
docker start CONTAINER_ID
To stop container use following command.
docker stop CONTAINER_ID
To attach to currently running container use following command.
docker attach CONTAINER_ID