containrrr / watchtower

A process for automating Docker container base image updates.
https://containrrr.dev/watchtower/
Apache License 2.0
19.71k stars 869 forks source link

Containers of a compose stack start in the wrong order #2006

Open thueske opened 4 months ago

thueske commented 4 months ago

Describe the bug

The containers in my compose stack start in the wrong order. The non-dependent containers are started first and the container that should actually be started first is started last.

Steps to reproduce

The containers in my compose stack start in the wrong order. The non-dependent containers (media-browser-1, media-app-1, media-dlna-1, media-server-1) are started first and the container that should actually be started first (media-vpn-1) is started last. I think it only happens when using the network_mode: "service:vpn" (see in Environment).

Expected behavior

When updating the image of media-vpn-1, the media-vpn-1 container should be started first and then the other containers.

Screenshots

No response

Environment

Latest docker and watchtower.

services:
  vpn:
    image: myvpn:latest
    restart: unless-stopped

  browser:
    image: mybrowser:latest
    restart: unless-stopped
    depends_on:
      vpn:
        condition: service_healthy
    network_mode: "service:vpn"

  app:
    image: myapp:latest
    restart: unless-stopped
    depends_on:
      vpn:
        condition: service_healthy
    network_mode: "service:vpn"

  dlna:
    image: mydlna:latest
    restart: unless-stopped
    depends_on:
      vpn:
        condition: service_healthy
    network_mode: "service:vpn"

  server:
    image: myserver:latest
    restart: unless-stopped
    depends_on:
      vpn:
        condition: service_healthy
    network_mode: "service:vpn"

Your logs

app-1  | time="2024-07-29T03:07:05+02:00" level=info msg="Stopping /media-server-1 (f2f85a6505d0) with SIGTERM"
app-1  | time="2024-07-29T03:07:06+02:00" level=info msg="Creating /media-server-1"
app-1  | time="2024-07-29T03:07:07+02:00" level=info msg="Stopping /media-dlna-1 (fdcaab46b6b8) with SIGTERM"
app-1  | time="2024-07-29T03:07:08+02:00" level=info msg="Creating /media-dlna-1"
app-1  | time="2024-07-29T03:07:08+02:00" level=info msg="Stopping /media-app-1 (997b5e7043b4) with SIGTERM"
app-1  | time="2024-07-29T03:07:14+02:00" level=info msg="Creating /media-app-1"
app-1  | time="2024-07-29T03:07:14+02:00" level=info msg="Stopping /media-browser-1 (4d28dbd5ac9a) with SIGTERM"
app-1  | time="2024-07-29T03:07:19+02:00" level=info msg="Creating /media-browser-1"
app-1  | time="2024-07-29T03:07:20+02:00" level=info msg="Stopping /media-vpn-1 (b851fda3d3e3) with SIGTERM"
app-1  | time="2024-07-29T03:07:21+02:00" level=info msg="Creating /media-vpn-1"
app-1  | time="2024-07-29T03:07:37+02:00" level=warning msg="Unable to resolve network container: Error response from daemon: No such container: b851fda3d3e3050f5121bf3aa55440817455568e22cad73055fcb1c6c28e8dc8" container=/media-browser-1 error="Error response from daemon: No such container: b851fda3d3e3050f5121bf3aa55440817455568e22cad73055fcb1c6c28e8dc8" network-container=b851fda3d3e3050f5121bf3aa55440817455568e22cad73055fcb1c6c28e8dc8
app-1  | time="2024-07-29T03:07:37+02:00" level=warning msg="Unable to resolve network container: Error response from daemon: No such container: b851fda3d3e3050f5121bf3aa55440817455568e22cad73055fcb1c6c28e8dc8" container=/media-app-1 error="Error response from daemon: No such container: b851fda3d3e3050f5121bf3aa55440817455568e22cad73055fcb1c6c28e8dc8" network-container=b851fda3d3e3050f5121bf3aa55440817455568e22cad73055fcb1c6c28e8dc8
app-1  | time="2024-07-29T03:07:37+02:00" level=warning msg="Unable to resolve network container: Error response from daemon: No such container: b851fda3d3e3050f5121bf3aa55440817455568e22cad73055fcb1c6c28e8dc8" container=/media-dlna-1 error="Error response from daemon: No such container: b851fda3d3e3050f5121bf3aa55440817455568e22cad73055fcb1c6c28e8dc8" network-container=b851fda3d3e3050f5121bf3aa55440817455568e22cad73055fcb1c6c28e8dc8
app-1  | time="2024-07-29T03:07:37+02:00" level=warning msg="Unable to resolve network container: Error response from daemon: No such container: b851fda3d3e3050f5121bf3aa55440817455568e22cad73055fcb1c6c28e8dc8" container=/media-server-1 error="Error response from daemon: No such container: b851fda3d3e3050f5121bf3aa55440817455568e22cad73055fcb1c6c28e8dc8" network-container=b851fda3d3e3050f5121bf3aa55440817455568e22cad73055fcb1c6c28e8dc8
app-1  | time="2024-07-29T03:07:37+02:00" level=info msg="Session done" Failed=0 Scanned=49 Updated=8 notify=no

Additional context

No response

github-actions[bot] commented 4 months ago

Hi there! 👋🏼 As you're new to this repo, we'd like to suggest that you read our code of conduct as well as our contribution guidelines. Thanks a bunch for opening your first issue! 🙏