Skip to content

[Bug]: Podman recreated container drops hostname, log driver, timezone, umask #1563

Description

@calvinbui

Bug Report Checklist

  • I checked existing issues and found no duplicates.
  • I have reviewed Watchtower's documentation and confirmed compliance with documented configuration specifications.
  • I have restarted Docker, re-pulled the latest image, and confirmed that the issue persists.

Bug Description

When Watchtower recreates a podman container after an image update, several flags from the original podman run are not preserved. CreateCommand is also absent on the new container, suggesting the run config is reconstructed from the inspect API rather than replayed, with some fields dropped or reset to defaults.

Steps to Reproduce

  1. Create a podman container with specific fields
  2. Let Watchtower recreate it on an image update
  3. podman inspect and compare the fields

Differences from the original and recreated container:

Field Original Recreated
Config.Hostname floccus 1dc1e75f14ed (short ID)
HostConfig.LogConfig.Type k8s-file json-file
HostConfig.LogConfig.Size 1MB -1B (unlimited)
Config.Timezone Australia/Sydney (unset)
Config.Umask 0022 0000
Config.CreateCommand Full podman run array (absent)
Config.sdNotifyMode container (absent)

Bind mounts, network, DNS, tmpfs, restart policy, stop timeout/signal, pids limit, ulimits, shm size, exposed ports, and labels are all preserved.

Expected Behavior

Recreated container should match the original's runtime configuration.

Watchtower Version

1.16.1

Docker Version

calvin@homeserver:~$ podman version
Client:        Podman Engine
Version:       5.8.1
API Version:   5.8.1
Go Version:    go1.26.2
Built:         Sat Apr 11 06:23:05 2026
Build Origin:  Debian
OS/Arch:       linux/amd64

Docker Info (optional)

calvin@homeserver:~$ podman info
host:
  arch: amd64
  buildahVersion: 1.43.1
  cgroupControllers:
  - cpuset
  - cpu
  - io
  - memory
  - hugetlb
  - pids
  - rdma
  - misc
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon_2.1.12-4_amd64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.12, commit: unknown'
  cpuUtilization:
    idlePercent: 94.05
    systemPercent: 2.28
    userPercent: 3.67
  cpus: 28
  databaseBackend: sqlite
  distribution:
    codename: trixie
    distribution: debian
    version: "13"
  eventLogger: journald
  freeLocks: 1780
  hostname: homeserver
  idMappings:
    gidmap: null
    uidmap: null
  kernel: 6.12.74+deb13+1-amd64
  linkmode: dynamic
  logDriver: journald
  memFree: 23998648320
  memTotal: 267743318016
  networkBackend: netavark
  networkBackendInfo:
    backend: netavark
    defaultNetwork: podman
    dns:
      package: aardvark-dns_1.14.0-3_amd64
      path: /usr/lib/podman/aardvark-dns
      version: aardvark-dns 1.14.0
    package: netavark_1.16.1-3.1_amd64
    path: /usr/lib/podman/netavark
    version: netavark 1.16.1
  ociRuntime:
    name: crun
    package: crun_1.21-1_amd64
    path: /usr/bin/crun
    version: |-
      crun version 1.21
      commit: 10269840aa07fb7e6b7e1acff6198692d8ff5c88
      rundir: /run/crun
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +WASM:wasmedge +YAJL
  os: linux
  pasta:
    executable: /usr/bin/pasta
    package: passt_0.0~git20250503.587980c-2+deb13u1_amd64
    version: ""
  remoteSocket:
    exists: true
    path: /run/podman/podman.sock
  rootlessNetworkCmd: pasta
  security:
    apparmorEnabled: true
    capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: false
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: false
  serviceIsRemote: false
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns_1.2.1-1.1_amd64
    version: |-
      slirp4netns version 1.2.1
      commit: 09e31e92fa3d2a1d3ca261adaeb012c8d75a8194
      libslirp: 4.8.0
      SLIRP_CONFIG_VERSION_MAX: 5
      libseccomp: 2.6.0
  swapFree: 34359734272
  swapTotal: 34359734272
  uptime: 112h 11m 12.00s (Approximately 4.67 days)
  variant: ""
plugins:
  authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  - ipvlan
  volume:
  - local
registries: {}
store:
  configFile: /usr/share/containers/storage.conf
  containerStore:
    number: 199
    paused: 0
    running: 198
    stopped: 1
  graphDriverName: overlay
  graphOptions:
    overlay.mountopt: nodev
  graphRoot: /var/lib/containers/storage
  graphRootAllocated: 1966706270208
  graphRootUsed: 347500068864
  graphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Supports shifting: "true"
    Supports volatile: "true"
    Using metacopy: "false"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 148
  runRoot: /run/containers/storage
  transientStore: false
  volumePath: /var/lib/containers/storage/volumes
version:
  APIVersion: 5.8.1
  BuildOrigin: Debian
  Built: 1775852585
  BuiltTime: Sat Apr 11 06:23:05 2026
  GitCommit: ""
  GoVersion: go1.26.2
  Os: linux
  OsArch: linux/amd64
  Version: 5.8.1

Docker Compose Configuration

Docker CLI Command

podman container run \
--name watchtower \
--dns 10.127.40.1 \
--dns-search example.com \
--env TZ=Australia/Sydney \
--env WATCHTOWER_SCHEDULE=0 25 10 * * * \
--env WATCHTOWER_CLEANUP=true \
--env WATCHTOWER_REMOVE_VOLUMES=true \
--env WATCHTOWER_DISABLE_MEMORY_SWAPPINESS=true \
--env WATCHTOWER_INCLUDE_STOPPED=true \
--env WATCHTOWER_REVIVE_STOPPED=true \
--env WATCHTOWER_LABEL_ENABLE=false \
--env WATCHTOWER_MONITOR_ONLY=true \
--hostname watchtower \
--log-driver k8s-file \
--network pub:mac=0A:0A:E4:81:97:3F \
--restart=always \
--stop-timeout 60 \
--tz=Australia/Sydney \
--label traefik.enable=false \
--label com.centurylinklabs.watchtower.enable=false \
--log-opt max-size=1m \
--volume /run/podman/podman.sock:/var/run/docker.sock \
--detach=True ghcr.io/nicholas-fedor/watchtower:1.16.1

Debug Logs

calvin@homeserver:~$ podman exec -it watchtower /watchtower --update-on-start --monitor-only=false floccus
INFO[0006] Watchtower 1.16.1 using Docker API v1.44
INFO[0006] Using no notifications
INFO[0006] Update on startup enabled: Performing immediate check
INFO[0006] Next scheduled run: 2026-04-18 10:25:00 AEST in 23 hours 52 minutes 7 seconds
INFO[0008] Found new image                               container=floccus image="public.ecr.aws/docker/library/httpd:2.4.66" new_id=e48c16e072a6
INFO[0008] Stopping container                            container=floccus id=a5c3f3bce7f1 signal=28 timeout=1m0s
INFO[0010] Started new container                         container=floccus id=a5c3f3bce7f1 new_id=1dc1e75f14ed
INFO[0010] Removing image                                image_id=9e0cccc06e8d image_name="public.ecr.aws/docker/library/httpd:2.4.66" notify=yes
INFO[0010] Update session completed                      failed=0 notify=no scanned=1 updated=1

Additional Context

No response

Metadata

Metadata

Labels

PodmanPodman-related itemsbugSomething isn't working

Projects

Status
Bug Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions