Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»Docker»How To Install and Use Docker on Fedora 37/36/35

    How To Install and Use Docker on Fedora 37/36/35

    By RahulDecember 14, 20223 Mins Read

    Docker is a container-based virtualization platform that has revolutionized the way developers build, deploy, and manage applications. It simplifies the process of creating, deploying, and managing containers on multiple operating systems. In this article, we will discuss how to install and use Docker on Fedora, one of the most popular Linux desktop distributions.

    Advertisement

    Installing Docker on Fedora

    The Docker team provides an official repository containing the Docker engine RPM packages. You just need to configure the RPM repository on your system to install the Docker engine.

    1. Remove all the existing installed Docker packages from your system. The following command will help you to remove older Docker packages from your system:
      sudo dnf remove docker docker-client docker-latest docker-common docker-client-latest docker-latest-logrotate docker-logrotate docker-engine 
      
    2. Next, install the dnf-utils package that provides dnf-config-manager command line utility:
      sudo dnf install dnf-utils 
      
    3. Add the official Docker rpm repository with the following command:
      sudo dnf-config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo 
      
    4. Finally, 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 docker-ce-cli containerd.io 
      
    5. After the successful installation of the Docker engine, Let’s enable and start the docker service. Also, enable the containerd service.
      sudo systemctl enable docker.service 
      sudo systemctl start docker.service 
      sudo systemctl enable containerd.service 
      

      Then check the status of the Docker service.

      How to Install and Use Docker on Fedora
      Running Docker service on Fedora

    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 
    
    Output:
    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. The below command list all images.

    sudo docker images
    
    Output:
    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. The 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 
    
    Output:
    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 
    

    Start/Stop/Attach Container

    You can start, stop or attach to any containers with the following commands. To start the container using the following command.

    docker start container_id 
    

    To stop a container, type:

    sudo docker stop container_id 
    

    To attach to the currently running container use the following command.

    sudo docker attach container_id 
    

    Conclusion

    In this article, we discussed how to install and use Docker on Fedora, one of the most popular Linux distributions. We discussed the benefits of using Docker, how to install it on fedora, and how to create and manage Docker containers. Finally, we discussed how to ensure the security of your Docker containers.

    Docker Docker engine fedora
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    Running a Cronjob Inside Docker: A Beginner’s Guide

    Running a Cronjob Inside Docker: A Beginner’s Guide

    Docker Run: A Beginner’s Guide to Run Docker Containers

    Docker Run: A Beginner’s Guide to Run Docker Containers

    Docker Build: A Beginner’s Guide to Building Docker Images

    Docker Build: A Beginner’s Guide to Building Docker Images

    View 4 Comments

    4 Comments

    1. Dro87 on January 8, 2020 1:12 pm

      Hello,

      I did it on Fedora 30 and got back

      Error:
      Problem: conflicting requests
      – nothing provides libcgroup needed by docker-ce-3:19.03.0-3.fc30.x86_64
      – nothing provides container-selinux >= 2:2.74 needed by docker-ce-3:19.03.0-3.fc30.x86_64
      – nothing provides libcgroup needed by docker-ce-3:19.03.1-3.fc30.x86_64
      – nothing provides container-selinux >= 2:2.74 needed by docker-ce-3:19.03.1-3.fc30.x86_64

      From where do I install the missing containers? DNF update makes nothing, or Yum update

      Reply
    2. piotr on August 13, 2019 8:03 pm

      on fedora 30 work fine 😀

      Reply
    3. Apollo440 on July 25, 2019 3:41 pm

      When you make articles like this, DO NOT FORGET to add section about PROPER uninstalling!

      Reply
    4. Clément Duveau on July 9, 2019 12:47 pm

      As you can see in https://github.com/docker/for-linux/issues/600, today, 9th of July 2019, this method doesn’t work for Fedora 30.
      Regards

      Reply

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • tail Command in Linux with Examples
    • What is a Orphan Process in Unix/Linux
    • How To Display Warning Message to Unauthorized SSH Access
    • How to Set a Custom SSH Login Banner and MOTD
    • Understanding Reverse DNS: What it is and Why it Matters?
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.