Skip to content

Docker Connection

Docker Host

Specifies the Docker daemon socket to connect to, supporting remote hosts via TCP (e.g., tcp://hostname:port).

            Argument: --host, -H
Environment Variable: DOCKER_HOST
                Type: String
             Default: unix:///var/run/docker.sock

Docker API Version

Sets the Docker API version for client-daemon communication.

            Argument: --api-version, -a
Environment Variable: DOCKER_API_VERSION
                Type: String
             Default: Autonegotiated

Note

Falls back to autonegotiation on failure.

Warning

Refer to Docker's API version matrix for compatibility.

Enable Docker TLS Verification

Enables TLS verification for Docker socket connections.

            Argument: --tlsverify
Environment Variable: DOCKER_TLS_VERIFY
                Type: Boolean
             Default: false

TLS Certificates Path

Path to TLS certificates for remote Docker connections.

            Argument: --cert-path
Environment Variable: DOCKER_CERT_PATH
                Type: String
             Default: None

Disable Memory Swappiness

Sets memory swappiness to nil for Podman compatibility with crun and cgroupv2, overriding Podman's default of 0.

            Argument: --disable-memory-swappiness
Environment Variable: WATCHTOWER_DISABLE_MEMORY_SWAPPINESS
                Type: Boolean
             Default: false

CPU Copy Mode

Controls how CPU settings are copied when recreating containers, addressing Podman compatibility issues with CPU limits. Podman handles NanoCPUs differently than Docker, which can cause container recreation failures.

            Argument: --cpu-copy-mode
Environment Variable: WATCHTOWER_CPU_COPY_MODE
                Type: String
     Possible Values: auto, full, none
             Default: auto

Note

  • auto: Automatically detects if running on Podman and filters NanoCPUs for compatibility. On Docker, copies all CPU settings.
  • full: Copies all CPU settings unchanged (original behavior).
  • none: Strips all CPU limits to avoid compatibility issues.

Use auto in mixed Docker/Podman environments. Use full if running only on Docker and want to preserve all CPU limits. Use none if CPU limits are causing issues and you prefer no limits on recreated containers.

Usage Examples

Run Watchtower with automatic CPU compatibility:

docker run -d \
    --name watchtower \
    -v /var/run/docker.sock:/var/run/docker.sock \
    nickfedor/watchtower \
    --cpu-copy-mode auto

Force full CPU copying (Docker-only environments):

docker run -d \
    --name watchtower \
    -v /var/run/docker.sock:/var/run/docker.sock \
    nickfedor/watchtower \
    --cpu-copy-mode full

Strip all CPU limits:

docker run -d \
    --name watchtower \
    -v /var/run/docker.sock:/var/run/docker.sock \
    nickfedor/watchtower \
    --cpu-copy-mode none

Recreating Containers on Podman

Watchtower talks to Podman through its Docker-compatible API. It recreates a container from what that API reports, so a setting the API does not carry is lost on recreation.

Setting Why it is lost After recreation
Timezone (--tz) It exists only in Podman's own API The image's timezone
Umask (--umask) It exists only in Podman's own API The OCI runtime's default umask, normally 0022
A k8s-file log driver and its options, such as max-size The API reports the driver as json-file and leaves out its options json-file without those options, so the log size limit falls back to log_size_max in containers.conf (unlimited by default)
Podman metadata, such as CreateCommand and the systemd notify mode It is not part of the Docker API Not set
A static IP address set with --ip or --ip6, or with ipv4_address or ipv6_address in Compose Podman does not report it A new address from the network, except that Podman 5.8 keeps the IPv4 address

To work around these losses:

  • Set the timezone through the TZ environment variable, which Watchtower keeps on recreation and which takes effect when the image or application reads it.
  • Let other containers reach the container by its name, which Podman resolves for containers on the same bridge network unless the network was created with --disable-dns. Clients outside that network can use a published port.
  • Manage the container with a Podman Quadlet that sets AutoUpdate=registry and the com.centurylinklabs.watchtower.enable=false label, so that podman auto-update updates it instead of Watchtower. Podman recreates the container from the unit, which keeps every setting above.