-
Is your feature request related to a problem? Please describe.I'm not sure where to post this so please forgive me. I want to use watchtower with private registries and config.json from docker secret. As stated in the documentation, to change the config.json location, DOCKER_CONFIG must be used. My config looks like this: services:
watchtower:
image: containrrr/watchtower
environment:
DOCKER_CONFIG: /run/secrets
volumes:
- /var/run/docker.sock:/var/run/docker.sock
container_name: watchtower
secrets:
- source: dockerhub_auth
target: config.json
secrets:
dockerhub_auth:
file: /path_to/config.json
secrets:
- source: dockerhub_auth
target: config.json change the name of secret to be config.json This solution seemed a bit hacky to me and also makes other environment variables unusable. environment:
- DOCKER_CONFIG: /run/secrets
- WATCHTOWER_POLL_INTERVAL=5 gives
Describe the solution you'd likeSomething like: services:
watchtower:
image: containrrr/watchtower
environment:
- **PATH_TO_AUTH.JSON: /run/secrets/dockerhub_auth**
- WATCHTOWER_POLL_INTERVAL=5
- ...
secrets:
- dockerhub_auth
secrets:
dockerhub_auth:
**file: /path_to/auth.json** Maybe auth.json could store only auth part of docker config.json file and be merged with config.json while running? environment:
REGISTRY_NAME=https://index.docker.io/v1/
AUTH_STRING=dockerhub_auth Describe alternatives you've consideredDescribed above. Additional contextI am not a docker expert, so please let me know if there is a better way to do this correctly. Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You could argue that
You are mixing docker compose yaml syntaxes. So, either: environment:
DOCKER_CONFIG: /run/secrets
WATCHTOWER_POLL_INTERVAL: 5 Or environment:
- DOCKER_CONFIG=/run/secrets
- WATCHTOWER_POLL_INTERVAL=5 |
Beta Was this translation helpful? Give feedback.
You could argue that
DOCKER_CONFIG
should point to the full file path for the config, but this convention was adopted from the docker client which uses the same environment variable in that way. The intention was to make the transition from docker to watchtower as seamless as possible.You are mixing docker compose yaml syntaxes.
You can either use
- KEY=VALUE
orKEY: VALUE
for the environment variables, but you cannot mix them.So, either:
Or