nerdctl icon indicating copy to clipboard operation
nerdctl copied to clipboard

[Compose] restart=always does not work properly

Open piyoki opened this issue 3 years ago • 4 comments

Description

Hi, I am experiencing an issue where I defined the restart=always param in the docker-compose.yml, but the container does not spin up at boot.

Steps to reproduce the issue

  1. Prepare a docker-compose.yml for the container
version: "3.4"

services:
  uptime-kuma:
    image: louislam/uptime-kuma
    container_name: uptime-kuma
    restart: always
    networks:
      - proxy
    volumes:
      - /etc/uptime-kuma:/app/data
    ports:
      - 3001:3001

networks:
  proxy:
    name: proxy
  1. Run nerdctl compose up -d to spin up the container

Describe the results you received and expected

The container is able to spin up at its first launch with the nerdctl compose up -d command. However, when the machine is rebooted, the container stops and not able to spin up again.

I assume that Nerdctl inherits the generic feature of starting the container at boot if the restart=always param persists in the docker-compose.yml

What version of nerdctl are you using?

0.17.0-beta.0

Are you using a variant of nerdctl? (e.g., Rancher Desktop)

No response

Host information

No response

piyoki avatar May 22 '22 05:05 piyoki

I experienced the similar issue

mptm436 avatar May 22 '22 05:05 mptm436

Is this issue about rootless or rootful?

For rootless you might need sudo loginctl enable-linger $(whoami) to run the containerd daemon (which restarts the contaienrs) on the host start-up: https://rootlesscontaine.rs/getting-started/common/login/

AkihiroSuda avatar May 23 '22 01:05 AkihiroSuda

Is this issue about rootless or rootful?

For rootless you might need sudo loginctl enable-linger $(whoami) to run the containerd daemon (which restarts the contaienrs) on the host start-up: https://rootlesscontaine.rs/getting-started/common/login/

I am running it in rootful mode

piyoki avatar May 23 '22 02:05 piyoki

cc @junnplus

fahedouch avatar Jun 07 '22 10:06 fahedouch