最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Docker Container not starting after reboot - Stack Overflow

programmeradmin1浏览0评论

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
Add a comment  | 

1 Answer 1

Reset to default 0

After using the documentation provided by @jabaa docs.podman.io/en/v4.4/markdown/options/restart.html

  1. Verified that I was using podman with:
$ docker version
  1. Checked the status of podman-restart.service
$ systemctl status podman-restart.service
  1. Service was not running, so I enabled the service:
$ systemctl enable podman-restart.service
  1. Restarted the host machine
  2. Checked container status
  3. 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

发布评论

评论列表(0)

  1. 暂无评论