To check the status of the docker service following command is used.
[rocky@server1 ~]$ sudo systemctl status docker
Finally, the command to check the version of the docker.
[rocky@server1 ~]$ docker --verison
After the installation and the enable process, check whether the docker is running by typing the following command.
[rocky@server1 ~]$ docker run hello-world
The above result verifies that the container ‘hello-world’ was successfully launched, as well as the installation of Docker.
Docker Compose is a tool that was created to assist in the definition and sharing of multi-container applications. With Compose, we can specify the services in a YAML file and then spin everything up or down with a single command.
Use the curl command to transfer data from the github and proceed to install the docker-compose. First, install the curl using the dnf command.
[rocky@server1 ~]$ sudo dnf install -y curl
Now, use the curl command to transfer the docker compose data from GitHub to the local machine.
[rocky@server1 ~]$ sudo curl -L "https://github.com/docker/compose/releases/download/ 1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
Here, execute permission is given to the docker-compose using the chmod command.
[rocky@server1 ~]$ sudo chmod +x /user/local/bin/docker-compose
Finally, check the version of the docker-compose using the following command.
[rocky@server1 ~]$ sudo docker-compose -- version
The above example and command are for the installation of docker and docker-compose on Rocky Linux. Thank you for checking it out!!