-
Notifications
You must be signed in to change notification settings - Fork 312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker compose restarting service with docker.io/library/ container #967
Comments
I confirm the bug in version 10.0.1. What's happening? The function exists? compares the compose.yaml with what is currently running: /usr/bin/docker compose -f compose.yaml -p netbox config and then fetches the
this will output the image name of the running container, with docker.io omitted because it's hardcoded as the default provider. In my case with the netbox stack: # reading current conf
vm-prod-netbox2 [/srv/netbox]# /usr/bin/docker ps --format '{{.Label "com.docker.compose.service"}}-{{.Image}}' --filter label=com.docker.compose.project=netbox
netbox-housekeeping-netboxcommunity/netbox:v4.1.4-3.0.2
netbox-worker-netboxcommunity/netbox:v4.1.4-3.0.2
nginx-nginx:alpine-slim
netbox-netboxcommunity/netbox:v4.1.4-3.0.2
redis-valkey/valkey:8.0-alpine
postgresql-postgres:13-alpine
redis-cache-valkey/valkey:8.0-alpine
# reading conf from compose.yaml file
vm-prod-netbox2 [/srv/netbox]# /usr/bin/docker compose -f /srv/netbox/compose.yaml -p netbox config | yq .services[].image
netboxcommunity/netbox:v4.1.4-3.0.2
netboxcommunity/netbox:v4.1.4-3.0.2
netboxcommunity/netbox:v4.1.4-3.0.2
nginx:alpine-slim
postgres:13-alpine
docker.io/valkey/valkey:8.0-alpine
docker.io/valkey/valkey:8.0-alpine exists? tests that count is the same (7 on both side), but images name are not the same, so puppet concludes that the stack must be reapplied. If I drop the docker.io/ from my compose.yaml, my node changes his status to "UNCHANGED" |
Maybe we can use this regexp to "canonicalize" the image name from the config, at the end of the get_image function:
This regexp
|
Describe the Bug
docker_compose
will not register a service as running if one of the containers uses an image in the formdocker.io/library/<name>
. This seems to be an old format but it is still valid and used (eg. by authentik).Expected Behavior
The provider should handle prefixes like this and ignore them when looking for running containers. The running container will show
<name>:<version>
rather thandocker.io/library/<name>:<version>
.Steps to Reproduce
Steps to reproduce the behavior:
docker_compose
resourceEnvironment
Additional Context
I followed the authentik docs for setup and then moved the
.env
anddocker-compose.yaml
files to puppetThe text was updated successfully, but these errors were encountered: