Learn how to install Docker CE on Rocky Linux 8 with this step-by-step guide. Follow along to set up Docker’s community edition and start containerizing your applications efficiently. #centlinux #linux #docker
Docker CE, or Docker Community Edition, is a free and open-source version of the Docker platform. It provides the essential tools for building, shipping, and running containerized applications. Docker CE includes the Docker Engine, which is the runtime environment for containers, along with command-line tools and utilities for managing containers and images.
Key features of Docker CE include:
Overall, Docker CE simplifies the process of building, deploying, and managing applications using containers, making it a popular choice for developers, DevOps teams, and organizations seeking agile and efficient software delivery practices.
In Red Hat Enterprise Linux (RHEL) 8 / CentOS 8 or later, Support of Docker has been removed by the vendor. Whereas a new containerization platform libpod (Podman’s Container Management Library) has been introduced as a replacement of Docker.
However, you can still install Docker and it’s dependencies on Rocky Linux 8 from third party yum repositories.
Docker Compose is a tool provided by Docker that simplifies the process of defining and running multi-container Docker applications. It allows you to use a YAML file to configure the services, networks, and volumes required for your application and then spin up all the containers with a single command.
Here are the key features and components of Docker Compose:
Overall, Docker Compose streamlines the process of working with Docker containers, especially for development and testing environments, by providing a simple and consistent way to define, configure, and manage multi-container applications.
Docker.io and Docker CE (Community Edition) are closely related but refer to slightly different aspects of the Docker ecosystem:
In summary, Docker.io represents the broader Docker ecosystem, including the core Docker software, while Docker CE is a specific edition of Docker tailored for community users and developers, providing an easy-to-use platform for containerization.
Recommended eBook: Docker Deep Dive: Zero to Docker in a single book (PAID LINK) by Nigel Poulton
Recommended Online Training: Docker & Kubernetes: The Practical Guide [AWS Platform]
We are using a minimal Rocky Linux 8 virtual machine with following specifications.
Read Also: How to run Keycloak Docker Container
By using a SSH client, login to docker-01.centlinux.com as root user.
Refresh yum cache by executing following command.
# dnf makecache Rocky Linux 8 - AppStream 1.5 kB/s | 4.8 kB 00:03 Rocky Linux 8 - AppStream 535 kB/s | 8.8 MB 00:16 Rocky Linux 8 - BaseOS 1.6 kB/s | 4.3 kB 00:02 Rocky Linux 8 - BaseOS 531 kB/s | 3.6 MB 00:06 Rocky Linux 8 - Extras 1.2 kB/s | 3.5 kB 00:02 Rocky Linux 8 - Extras 2.0 kB/s | 11 kB 00:05 Last metadata expiration check: 0:00:01 ago on Thu 30 Jun 2022 08:51:51 PM PKT. Metadata cache created.
Execute following dnf command to update your Linux operating system.
# dnf update -y
If the above command updates your Linux Kernel, then reboot your operating system with newly installed Kernel.
# reboot
Verify the versions of your Linux Kernel and operating system.
# cat /etc/rocky-release Rocky Linux release 8.6 (Green Obsidian) # uname -r 4.18.0-372.13.1.el8_6.x86_64
Docker CE is also available to download from Docker’s official website. However, there is a better way to install it from Docker yum repository.
For this purpose, add Docker yum repository by using dnf command.
# dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo Adding repo from: https://download.docker.com/linux/centos/docker-ce.repo
Build cache of newly installed yum repositories.
# dnf makecache Rocky Linux 8 - AppStream 1.6 kB/s | 4.8 kB 00:02 Rocky Linux 8 - BaseOS 1.7 kB/s | 4.3 kB 00:02 Rocky Linux 8 - Extras 1.2 kB/s | 3.5 kB 00:02 Docker CE Stable - x86_64 28 kB/s | 26 kB 00:00 Metadata cache created.
Now, you can easily install Docker CE on Linux by using a dnf command.
# dnf install -y docker-ce
Enable and start Docker service.
# systemctl enable --now docker.service Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /usr/lib/systemd/system/docker.service.
Verify the status of Docker service.
# systemctl status docker.service
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor pres>
Active: active (running) since Thu 2022-06-30 21:18:32 PKT; 16s ago
Docs: https://docs.docker.com
Main PID: 4460 (dockerd)
Tasks: 7
Memory: 35.2M
CGroup: /system.slice/docker.service
└─4460 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/contai>
Jun 30 21:18:30 rockylinux-01.centlinux.com dockerd[4460]: time="2022-06-30T21:>
Jun 30 21:18:30 rockylinux-01.centlinux.com dockerd[4460]: time="2022-06-30T21:>
Jun 30 21:18:30 rockylinux-01.centlinux.com dockerd[4460]: time="2022-06-30T21:>
Check the version of Docker Engine.
# docker version Client: Docker Engine - Community Version: 20.10.17 API version: 1.41 Go version: go1.17.11 Git commit: 100c701 Built: Mon Jun 6 23:03:11 2022 OS/Arch: linux/amd64 Context: default Experimental: true Server: Docker Engine - Community Engine: Version: 20.10.17 API version: 1.41 (minimum version 1.12) Go version: go1.17.11 Git commit: a89b842 Built: Mon Jun 6 23:01:29 2022 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.6.6 GitCommit: 10c12954828e7c7c9b6e0ea9b0c02b01407d3ae1 runc: Version: 1.1.2 GitCommit: v1.1.2-0-ga916309 docker-init: Version: 0.19.0 GitCommit: de40ad0
You have successfully install Docker CE on Rocky Linux 8.
Search Docker Hub for official image of Alpine Linux.
# docker search alpine --filter is-official=true NAME DESCRIPTION STARS OFFICIAL AUTOMATED alpine A minimal Docker image based on Alpine Linux… 8944 [OK]
Pull the Alpine Linux image to local Docker platform.
# docker pull alpine Using default tag: latest latest: Pulling from library/alpine 2408cc74d12b: Pull complete Digest: sha256:686d8c9dfa6f3ccfc8230bc3178d23f84eeaf7e457f36f271ab1acc53015037c Status: Downloaded newer image for alpine:latest docker.io/library/alpine:latest
List the locally available Docker images.
# docker images REPOSITORY TAG IMAGE ID CREATED SIZE alpine latest e66264b98777 5 weeks ago 5.53MB
Create a Docker Container from Alpine Linux image and start /bin/sh shell, so you can execute some test commands over there.
# docker run -it --rm alpine /bin/sh / # cat /etc/os-release NAME="Alpine Linux" ID=alpine VERSION_ID=3.16.0 PRETTY_NAME="Alpine Linux v3.16" HOME_URL="https://alpinelinux.org/" BUG_REPORT_URL="https://gitlab.alpinelinux.org/alpine/aports/-/issues" / # uname -r 4.18.0-372.13.1.el8_6.x86_64 / # exit
You can optionally install docker-compose software, if you want to run multiple Docker containers as a single service.
Download latest version of docker-compose from GitHub by using curl command.
# curl -L https://github.com/docker/compose/releases/download/v2.6.1/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 100 24.5M 100 24.5M 0 0 1037k 0 0:00:24 0:00:24 --:--:-- 1252k
Grant execution permissions to docker-compose file.
# chmod +x /usr/local/bin/docker-compose
Execute docker-compose command to check it’s version.
# docker-compose version Docker Compose version v2.6.1
Read Also: Setup a Private Docker Registry in Rocky Linux 8
Installing Docker CE on Rocky Linux 8 is a straightforward process that empowers you to leverage containerization for your applications. If you need personalized assistance or a customized setup, feel free to explore my services on Fiverr.
Puppy Linux is a fast, lightweight OS designed for speed and simplicity, perfect for old…
Learn how to change Apache document root in Linux by following this step-by-step guide. Adjust…
Discover how to change Apache port in Linux easily. Follow our simple guide to modify…
Learn how to create a virtual host in Apache Server with this comprehensive guide. Set…
Discover 10 practical tasks for the RHCSA exam with step-by-step solutions. Boost your Linux skills…
Discover the ultimate Fail2ban configuration guide. Learn how to set up, customize, and optimize Fail2ban…
This website uses cookies.