Run once without stopping/starting the watchtower container? #1314
|
Hi guys, Thanks! |
Answered by
nicholas-fedor
Feb 13, 2026
Replies: 1 comment 1 reply
|
There are two main methods of accomplishing this.
Docker CLI MethodTo perform a standard, single update run:docker exec -it <watchtower container name> /watchtower --run-onceFor example:root@it-tools:~/Docker# docker exec -it watchtower /watchtower --run-once
INFO[0001] Watchtower v1.14.1-b63f1f08 using Docker API v1.51
INFO[0001] Using notifications: gotify
WARN[0001] Run once mode: Disregarding update on start
INFO[0005] Found new image container=dozzle-agent image="harbor.papago.casa/docker/amir20/dozzle:latest" new_id=f7f0146bcabe
INFO[0008] Stopping container container=dozzle-agent id=21876fb7f5b5 signal=SIGTERM timeout=30s
INFO[0008] Started new container container=dozzle-agent id=21876fb7f5b5 new_id=19d62da23147
INFO[0008] Removing image image_id=150da7ba6434 image_name="harbor.papago.casa/docker/amir20/dozzle:latest" notify=yes
INFO[0008] Update session completed failed=0 notify=no scanned=6 updated=1If you want to just specify a single container to update:docker exec -it <watchtower container name> /watchtower --run-once <target container name>For example:root@it-tools:~/Docker# docker exec -it watchtower /watchtower --run-once it-tools
INFO[0001] Watchtower v1.14.1-b63f1f08 using Docker API v1.51
INFO[0001] Using notifications: gotify
WARN[0001] Run once mode: Disregarding update on start
INFO[0001] Update session completed failed=0 notify=no scanned=1 updated=0Docker CLI Usage:Usage: docker exec [OPTIONS] CONTAINER COMMAND [ARG...]
Execute a command in a running container
Aliases:
docker container exec, docker exec
Options:
-d, --detach Detached mode: run command in the background
--detach-keys string Override the key sequence for detaching a container
-e, --env list Set environment variables
--env-file list Read in a file of environment variables
-i, --interactive Keep STDIN open even if not attached
--privileged Give extended privileges to the command
-t, --tty Allocate a pseudo-TTY
-u, --user string Username or UID (format: "<name|uid>[:<group|gid>]")
-w, --workdir string Working directory inside the container |
1 reply
Answer selected by
janreinhardt
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There are two main methods of accomplishing this.
Docker CLI Method
To perform a standard, single update run:
For example: