amir20 / dozzle

Realtime log viewer for docker containers.
https://dozzle.dev/
MIT License
6.38k stars 318 forks source link

Container names do not reflect "docker rename" after creation #3389

Closed ambarbour closed 2 days ago

ambarbour commented 3 days ago

🔍 Check for existing issues

How is Dozzle deployed?

Standalone Deployment

📦 Dozzle version

v8.7.3

✅ Command used to run Dozzle

docker run \
  --name dozzle-log-viewer \
  --restart unless-stopped \
  -d \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -p 8080:8080 \
  --pull always \
  amir20/dozzle

🐛 Describe the bug / provide steps to reproduce it

We want to use Dozzle to monitor logs from containers managed by Dokku. When a Dokku app is deployed, it is started inside a container with a temporary name, must pass a health check, and then the container is renamed to the desired name.

Dozzle picks up the initial temporary container name as part of ContainerStart() but does not handle ContainerRename(), so after the Dokku app deployment is complete the Dozzle container name does not match the Docker name.

Please add support for ContainerRename() to stay in sync with Docker.

💻 Environment

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  app: Docker App (Docker Inc., v0.9.1-beta3)
  buildx: Build with BuildKit (Docker Inc., v0.6.3-docker)

Server:
 Containers: 24
  Running: 23
  Paused: 0
  Stopped: 1
 Images: 535
 Server Version: 20.10.11
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 7b11cfaabd73bb80907dd23182b9347b4245eb5d
 runc version: v1.0.2-0-g52b36a2
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: default
 Kernel Version: 5.4.0-1051-aws
 Operating System: Ubuntu 18.04.3 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 16
 Total Memory: 124.7GiB
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No swap limit support

📸 If applicable, add screenshots to help explain your bug

No response

📜 If applicable, attach your Dozzle logs. You many need to enable debug mode. See https://dozzle.dev/guide/debugging.

No response

amir20 commented 2 days ago

Today I learned there is such a thing as docker rename. If docker rename triggers an event then I can do this. I'll have to investigate.

amir20 commented 2 days ago

Implemented and it is currently in master. Can be tested with amir20/dozzle:master. Give it a try. I plan to release something tomorrow if 👍🏼

ambarbour commented 2 days ago

Works great, thanks for the fast turnaround!