I am working on a remote server which has centOS version VERSION="8.7 (Green Obsidian)"
.It was installed docker previously by another developer. The docker version was likely 4.x.x.In my docker-compose.yaml file I used version:'3'
In this version, docker basic commands like docker ps, docker images
etc. worked well. Then I installed docker-compose using
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose version
Then it was installed Docker Compose version v2.18.1
, Now I tried to run docker compose commands,it says can not connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
. Then tried to enable and start docker service,using
systemctl status docker
/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
sudo systemctl start docker
systemd([l]: docker.service: Main process exited, code=exited, status=1/FAILURE
systemd[l]: docker.service: Failed with result 'exit-code'.
systemd[l]: Failed to start Docker Application Container Engine.
1:48:40 systemd[l]: docker.service: Service RestartSec=2s expired, scheduling restart.
Jun as 11:48:40 systemd[l]: docker.service: Scheduled restart job, restart counter is at 3.
Jun 09 11:4 0 systemd[l]: Stopped Docker Application Container Engine.
Jun 09 11:48:40 systemd[l]: docker.service: Start request repeated too quickly.
Jun 09 11:48:40 systemd[l]: docker.service: Failed with result ‘'exit-code’. I
Jun 09 11:48:40 systemd[l]: Failed to start Docker Application Container Engine.
I try to find docker.service, docker.sock,containerd.service files in system folder, they were not available. Then i referred Unable to start Docker service with error "Failed to start docker.service: Unit not found." and created docker.service manually. Then, referred Cannot start docker daemon in CentOS7 and created docker.socket file. But could not find content for containerd.service file. Then also could not start docker service using sudo systemctl start docker
. Can I know whether it is a good idea to upgrade docker version 4.x.x to latest 23 instead of bothering about missing files and manually creating these missing files?. This official docker site shows the upgrading method as follows,
sudo yum install /path/to/package.rpm
sudo systemctl start docker
sudo docker run hello-world
yum -y upgrade