I've looked at other resources, and can't find much that is relevant to my situation.
I am running an instance with the following command
docker run -d --restart=unless-stopped --name my_container -v my_volume:/path/to/container container:latest
For some reason, when I reboot the host, the container does not start automatically.
Container Logs
On manual container start
level=info msg="redis not configured"
level=info msg="Starting upload purge in 57m"
level=info msg="Using inmemory blob descriptor cache"
level=info msg="Restricting TLS..."
level=info msg="Restricting TLS Ciphers..."
No logs get generated from container on reboot because container does not actually start.
I've checked journalctl
after reboot, and I see an entry for .mount
, but none in regards to a container starting.
I've inspected the containers meta data, and see the following
"CreateCommand": [
"--restart=always"
"RestartPolicy": {
"Name": "always",
I've inspected docker version
:
Client: Podman Engine
Version: 4.9.4
Finally I have tried multiple different parameters for --restart
, including: --restart unless-stopped
--restart always
In the past I've allowed persistency using systemctl, but I'm attempting to avoid that for consistency sake. Any ideas would be great, as I feel like everything that needs to be in place is, so I'm not sure why this is not working.
I'm running podman on RHEL 8
I've looked at other resources, and can't find much that is relevant to my situation.
I am running an instance with the following command
docker run -d --restart=unless-stopped --name my_container -v my_volume:/path/to/container container:latest
For some reason, when I reboot the host, the container does not start automatically.
Container Logs
On manual container start
level=info msg="redis not configured"
level=info msg="Starting upload purge in 57m"
level=info msg="Using inmemory blob descriptor cache"
level=info msg="Restricting TLS..."
level=info msg="Restricting TLS Ciphers..."
No logs get generated from container on reboot because container does not actually start.
I've checked journalctl
after reboot, and I see an entry for .mount
, but none in regards to a container starting.
I've inspected the containers meta data, and see the following
"CreateCommand": [
"--restart=always"
"RestartPolicy": {
"Name": "always",
I've inspected docker version
:
Client: Podman Engine
Version: 4.9.4
Finally I have tried multiple different parameters for --restart
, including: --restart unless-stopped
--restart always
In the past I've allowed persistency using systemctl, but I'm attempting to avoid that for consistency sake. Any ideas would be great, as I feel like everything that needs to be in place is, so I'm not sure why this is not working.
I'm running podman on RHEL 8
Share Improve this question edited Jan 31 at 14:00 Ambre asked Jan 30 at 16:15 AmbreAmbre 354 bronze badges 4- Please check your docker logs. What's in there? Give us a short overview of it. Thanks. – Mehdi Commented Jan 30 at 16:23
- I've added the logs that get generated when starting the container manually. All generated logs are info. – Ambre Commented Jan 31 at 14:01
- 1 You're talking about Docker but it looks like you're using Podman. That's a big difference. Docker is a daemon with client. Podman works more like an executable. That's probably the reason for your problem. docs.podman.io/en/v4.4/markdown/options/restart.html "Podman provides a systemd unit file, podman-restart.service, which restarts containers after a system reboot." Is this service enabled and active? – jabaa Commented Jan 31 at 14:08
- Please ask only one question and don't ask follow-up questions in comments. If you have a new question, post a new question. – jabaa Commented Jan 31 at 14:26
1 Answer
Reset to default 0After using the documentation provided by @jabaa docs.podman.io/en/v4.4/markdown/options/restart.html
- Verified that I was using podman with:
$ docker version
- Checked the status of podman-restart.service
$ systemctl status podman-restart.service
- Service was not running, so I enabled the service:
$ systemctl enable podman-restart.service
- Restarted the host machine
- Checked container status
- Container now starts on reboot.
If you would like to edit the restart policy, or how the service determines what containers get effected, you can find the unit file for this service at /usr/lib/systemd/system/podman-restart.service