Hi Team I have changed the docker root directory location from /var/lib/docker . . .

saravanan veera:
Hi Team

I have changed the docker root directory location from /var/lib/docker to my custom location. All the files are copied from the docker root directory.

If I created a new container it was working fine

How can i up the previously running container
Previous running container and docker images not showing. Kindly help me on this

Al West:
Make sure permissions are set correctly. It is recommend to copy with rsync. Also check the Docker service logs:

journalctl -xu docker

saravanan veera:
Yes, for the coping the file used rsync

Al West:
please paste the command line you ran for rsync

saravanan veera:
rsync -avxp /var/lib/docker/ /docker

Al West:
Is there anything showing in the logs?

saravanan veera:
Journalctl log:

Jul 13 11:52:05 sprint-nexus-common dockerd[49246]: time=“2023-07-13T11:52:05.399260101Z” level=info msg=“ignoring event” container=24375a60ec3825c863fe35acc5f5214f1735392f9d5d922572d7e5aaa8df4242 >

Jul 13 11:52:06 sprint-nexus-common dockerd[49246]: 2023/07/13 11:52:06 http2: server: error reading preface from client @: read unix /run/docker.sock->@: read: connection reset by peer

Jul 13 11:52:06 sprint-nexus-common dockerd[49246]: time=“2023-07-13T11:52:06.622925383Z” level=warning msg=“no trace recorder found, skipping”

Al West:
is that all that is in the logs?

Al West:
I take it you stopped all your containers before copying and then tried to restart them.

Al West:
And you are sure docker images is not showing your old images?

saravanan veera:
Yes, i stopped the container before the rsync

Al West:
What is the contents of /etc/docker/daemon.json

saravanan veera:
{
“data-root”: “/nodejs/docker”,
“log-driver”: “json-file”,
“log-opts”: {
“max-size”: “50m”,
“max-file”: “5”,
“labels”: “com.docker.compose.service,com.docker.compose.project,com.docker.compose.oneoff”
}
}

Al West:
Your rsync command does not match your data-root

saravanan veera:
The Rsync command used exactly which i have mentioned in the demon config file path

Previously I was given a sample path

Al West:
Did you restart the docker service?

saravanan veera:
Fixed the issue, Thanks for your assistance

Al West:
What was the fix?

Al West:
Will be helpful for others.

saravanan veera:
From our case after the file syncs someone update the docker package that’s the issue