Comments (5)
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 are you trying to achieve? Without interpolation image tags is invalid and obviously command can't succeed. I would expect command to fail and not hang, which is a bug then, still I'd like to better understand your usage
from compose.
Can you replicate this issue by running this same command locally?
Have you tried using latest release v2.27.0?
from compose.
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.
from compose.
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.
- Have a docker-compose file containing several variables.
- Build services
- Push services
- Action "Write service image digests" of task "dockercompose@0", which creates a separate docker-compose file containing only the image references using the digests.
- I then combine the original docker-compose file with the newly generated docker-compose file without interpolation. The result is a docker-compose file with concrete references to the images (digests), but still all variable tokens present.
- Push the resulting file as a build artifact.
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.
from compose.
Ok. It seems what you would like is some docker compose config --resolve-image-digests --images
command (not yet implemented) to list images with digest, you could format into some compose-with-digests override file
from compose.
Related Issues (20)
- [BUG] Inconsistent behavior of profiles and remove-orphans
- Assign container name to /sys/class/net//ifalias in docker compose
- Add warning when use `env_file` and `environments` at the same time HOT 2
- "unsupported opentelemetry exporter None" with "docker-compose up" HOT 9
- [BUG] Unable to access applicaton on port 8080 when using host network mode on Windows
- How to append the already existing environment variable instead of overriding them HOT 2
- [BUG] docker-compose build is not caching layers HOT 5
- https://myactivity.google.co/
- [BUG] Why does `compose up` always recreate one-shot containers? HOT 6
- [BUG] Using docker-compose with Windows Containers and dockerfile_inline does not work (is ignored)
- [BUG] docker compose watch <service> ignores depdends_on definitions HOT 1
- [BUG] !reset tag does not work on environment keys when multiple files contibute HOT 2
- [BUG] critical error with max length project name HOT 10
- Add environment variables for client OS/arch and client user UID/GID
- Docker run with env-file and volume mounting HOT 2
- [BUG] Regressions in .env loading HOT 4
- Exited Containers Missing in Docker Compose Status with Custom Config HOT 4
- [BUG] Disable IPv4 and Use IPv6 Network Only for Docker Networks and Containers HOT 1
- [ISSUE]how to fix top-level object must be mapping HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from compose.