run checkConsistency after profiles were applied#606
Merged
ndeloof merged 1 commit intocompose-spec:mainfrom Mar 21, 2024
Merged
run checkConsistency after profiles were applied#606ndeloof merged 1 commit intocompose-spec:mainfrom
ndeloof merged 1 commit intocompose-spec:mainfrom
Conversation
|
Just to clarify the use case in #11616 (which was marked as a duplicate of this). I am using the profiles to have one profile without and another with redundancy (of solr and zookeeper). This means that a lot of configuration and container dependencies change. Still it is useful to have a stable name of the "lead" container across profiles, as it makes it possible to do "docker cp" and "docker exec" from scripts that are not profile aware. I am using environment variables for a lot, but it does not work for all use cases. |
|
There is also a question of how far do you want to go with such checks ... $ docker compose -f - up --scale service=2 <<-'EOF'
services:
service:
image: nginx
container_name: service
EOF
WARNING: The "service" service is using the custom container name "service". Docker requires each container to have a unique name. Remove the custom name to scale the service.
|
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
fecab4a to
5e2cf2d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
run checkConsistency after profiles were applied.
If we don't, some services may refer to dependencies disabled by profile
As a side effect, this also allows to (ab)use profiles to define same resource twice with distinct configuration:
close docker/compose#11619.