Closed sami-sweng closed 4 weeks ago
Note: I thought it could have been caused by docker data corruption when the container shuts down so I tried to gracefully shutdown the container before committing, using:
pids=$(pgrep supervisord)
kill $pids
sleep 10
but without success.
Other note, The first tentative is meant to fail (thank you @greut) and as discussed here My second tentative with a volume kept consistent across restarts cause the exact same issue so overlayfs-over-overlayfs might not be the root cause of the above.
Hello @sami-sweng, sorry for the delay.
You should be able to persist images, build, etc, just by executing the container like this:
docker run -it -v $(pwd)/var-lib-docker:/var/lib/docker --privileged cruizba/ubuntu-dind
Hey @cruizba,
no problem and thank you for the answer.
Unfortunately I have the same issue after committing and reusing the same volume:
Error response from daemon: failed to create task for container: failed to start shim: mkdir /var/run/docker/containerd/daemon/io.containerd.runtime.v2.task/moby/3c3c58346fb0104c8b8ad7031811ecea657a738348b1415bb035a163afacb7cb: file exists: unknown
Maybe it's an issue with my setup only..? (Ubuntu 22.04, docker 24.0.6 host, 26.0.0 inside) Are you able to commit a container and restart it without issue?
Ah, are you committing?
I think that's not possible unfortunately :(
If your purpose is to store images inside another image, it is not possible AFAIK.
Ah, I see thank you...
Yes I commit as doing the setup in a dockerfile is not possible either...
Do you know why it's not possible?
Is there a way to keep the state of the container while also keeping the image cache and not having to download them all each time?
I tried to remove the line
VOLUME /var/lib/docker
in the Dockerfile, in order to persist docker state (image, build cache, etc...) inside the container but it is causing issues.When running docker compose up inside, after a commit and restart of a container with saved docker state.
I'm using Ubuntu 22.04 both host, container and sub-containers.
Any idea of the root cause?
BTW, thanks a lot for the project, very useful to have an Ubuntu based dind!