Last active
August 30, 2024 09:18
-
-
Save MikaelElkiaer/024222aafa49cc9fc1dd767628fcfb28 to your computer and use it in GitHub Desktop.
Docker Compose config-volume-dependency-bug
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
configs: | |
config: | |
content: | | |
config | |
services: | |
volumer: | |
command: | |
- sh | |
- -c | |
- | | |
mkdir -p /tmp/volume | |
echo volume > /tmp/volume/test.txt | |
image: alpine | |
volumes: | |
- tmp:/tmp | |
without-config: | |
command: | |
- sh | |
- -c | |
- | | |
cat /tmp/volume/test.txt | |
depends_on: | |
volumer: | |
condition: service_completed_successfully | |
image: alpine | |
volumes: | |
- type: volume | |
source: tmp | |
target: /tmp/volume | |
volume: | |
subpath: volume | |
read_only: true | |
without-config-too: | |
command: | |
- sh | |
- -c | |
- | | |
echo touched-too | |
depends_on: | |
without-config: | |
condition: service_completed_successfully | |
image: alpine | |
with-config: | |
command: | |
- sh | |
- -c | |
- | | |
cat /tmp/volume/test.txt | |
cat /tmp/config.txt | |
# WARN: Seems to break the volume mount when run as a dependency | |
configs: | |
- source: config | |
target: /tmp/config.txt | |
depends_on: | |
volumer: | |
condition: service_completed_successfully | |
image: alpine | |
volumes: | |
- type: volume | |
source: tmp | |
target: /tmp/volume | |
volume: | |
subpath: volume | |
read_only: true | |
with-config-too: | |
command: | |
- sh | |
- -c | |
- | | |
echo touched-too | |
depends_on: | |
with-config: | |
condition: service_completed_successfully | |
image: alpine | |
volumes: | |
tmp: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Running the scenarios: