fmartinou / whats-up-docker

What's up Docker ( aka WUD ) gets you notified when a new version of your Docker Container is available.
https://fmartinou.github.io/whats-up-docker
MIT License
939 stars 29 forks source link

Added support for linked/dependent containers #313

Open ThaDaVos opened 10 months ago

ThaDaVos commented 10 months ago

This pull request add supports by for linkend/dependent containers by checking the labels of other containers for specific values, including a custom label for manual linking: fmartinou.whatsupdocker.container.depends_on

This also resolves the issue when a containers get recreated which has other containers depend on it by network_mode: container:{CONTAINER_ID} (Also known with syntax sugar as network_mode: service:{SERVICE_NAME})

Should fix: https://github.com/fmartinou/whats-up-docker/issues/311 Locally running to test, also tested in testing environment by running the following docker-compose:

version: "3.9"

volumes:
  nexus_data:
    driver: local
  wud_data:
    driver: local
  certification:
    driver: local

services:
  parent:
   image: alpine:latest
   command: sleep infinity
   ports:
     - 8080:80
  child:
    image: nginxdemos/hello:latest
    network_mode: service:parent
  whatsupdocker:
    labels:
      - wud.watch=false
    environment:
      - WUD_LOG_LEVEL=debug
      - {ALL OTHER ENVS NOT INCLUDED}
ThaDaVos commented 10 months ago

Apparently the build fails because I use Node v18+ (latest LTS) features while the pipeline still uses v16?

ThaDaVos commented 10 months ago

@fmartinou have you taken a look yet?