-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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 config with profiles hangs indefinitely when combining "--no-interpolate" and "--resolve-image-digests" #11812
Comments
Can you replicate this issue by running this same command locally? |
I tried several things this morning. It seems that the combination of commands is causing issues. When using variables in the image property, such as "image: ${DOCKER_REGISTRY-}/${NAMESPACE-}/workerservice", it seems that "no interpolate" and "--resolve-image-digests" clash when using profiles somehow. It seems that the variables in the image property are properly interpolated according to the profile. Services that are excluded by the profile won't get a correctly interpolated image property. The resolving of the image digests will try to resolve all images of all services. If one image property still contains variables and not a correct URL, the command hangs indefinitely. So it seems that in this command chain, profiles are interpreted different, leading to some image properties being interpolated, some don't. If one image property is not interpolated, the problem arises. |
I didn't read carefully and didn't noticed you are using both variables in image tags and ask for digests to be resolved. |
What I'm trying to achieve is: A DevOps build pipeline which builds all services in a docker-compose file and pushes them to a registry. I then want someone to be able to do a release using a release pipeline, thereby using the artifact of the build pipeline (which is a docker-compose file containing a reference to the built images). During release, I have different variables depending on the specific environment it is released to. So I have a build pipeline now, which builds and pushes all images. The image digests are then retrieved and put in the service image properties of the docker-compose file (using devops task "dockercompose@0"). By default, all variables in the docker compose file are interpolated by this task, and if a variable value is not defined, it is substituted by an empty string. By default, at the end of a build, all my variable tokens are substituted by empty strings, so I can't use the variables anymore in a release pipeline.
I now can use variables in my release pipelines depending on the stage/environment, but I'm also sure that I'm using the correct images. |
Ok. It seems what you would like is some |
Description
Using DevOps build pipeline task "dockercompose@0", the task hangs indefinitely when resolving image digests without interpolation using profiles, and one or more of the services is being excluded by means of profiles.
microsoft/azure-pipelines-tasks#17808 (comment)
Steps To Reproduce
Add task "dockercompose@0" to a DevOps build pipeline. Because task "dockercompose@0" uses outdated "docker-compose" (instead of "docker compose"), apply the following fix (define a docker compose path):
microsoft/azure-pipelines-tasks#17808 (comment)
Create a docker compose file with 2 services and apply profiles, such as
Service "workerservice" is excluded when applying profile "dev". This seems to cause the build pipeline task to hang indefinitely.
The command that is created by the task looks like:
/usr/libexec/docker/cli-plugins/docker-compose -f /[snip]/docker-compose.yml -f /[snip]/.docker-compose.1715583828579.yml -p projectname config --no-interpolate --resolve-image-digests --output docker-compose.test.yml
Compose Version
Docker Environment
Anything else?
No response
The text was updated successfully, but these errors were encountered: