Docker is a container-based application framework, which wraps of a specific application with all its dependencies in a container. Docker containers can easily to ship to a remote location on start there without making entire application setup. This tutorial will help you to install Docker on Fedora 29/28/27 operating systems.

 

Step 1 – Prerequisites

 

For the standard installation, Docker required 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 on your system. Also, update the packages 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 docker community edition package to install docker on your system. This is installed many of required decencies on your system.

sudo dnf install docker-ce

 

After successful installation of 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.

sudo systemctl status 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 Docker hub. For example, below command will search all images with Fedora and list as output

sudo docker search fedora

 

Download Docker Images

 

Now download the Docker container with name Ubuntu on your local system using 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 the 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 container) use the following command.

docker ps -a

 

Start/Stop/Attach Container

 

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

 

Was this answer helpful? 0 Users Found This Useful (0 Votes)