• OAK4
  • Docker images/containers disappear after reboot – how to make them persistent?

Because the `oakapp` build keeps failing on my network, I switched to building and running everything directly with Docker.

Unfortunately, after every host reboot `docker images` and `docker ps -a` both come back empty, even though Docker itself starts fine.

Has anyone else seen this?

What is the recommended way to

1. guarantee that images and containers survive a reboot, and

2. keep Docker working normally without having to re-pull / re-build every time?

Any guidance on how to fix this permanently (or at least diagnose why Docker “forgets” its state) would be greatly appreciated.

Thanks in advance!


Environment

- Device: OAK-4-D

- Luxonis OS: 1.15.0

- oakctl: 0.12.5

Hey @MulongDeng
I'm sorry to hear that you're having troubles with oakctl app building. Could you write down the specific issue you're having?
We would like people to use oakctl for deploying standalone apps, but right now it can be annoying to use especially when you have to iterate a lot on your build_steps.

Recently we have implemented an oakctl app exec -i <cmd> command, which allows you to get an interactive shell in the container and thus makes it much easier to iterate on your build_steps and debug in general. This command will become supported in an OS release within the next two weeks.

So, back to the problem at hand. Docker is currently miss-configured on the OS as it stores all of it's data in temporary storage, which is wiped upon reboot.

To combat this you can perform the following steps on the device side:

systemctl stop docker
mkdir /data/docker-data
echo '{"data-root": "/data/docker-data"}' > /etc/docker/daemon.json
systemctl start docker

from here on out images and containers will persist accross reboot.

Thanks,
Filip

Hi @filipjeretina ,
Just a quick note to let you know that the network issue has been resolved—everything’s running as expected.
Following your suggestions, Docker is also behaving perfectly now.

Thanks again for your help!

Best regards