Comments (4)
As an additional check (since the linked commit mentions empty environment variables), changing docker compose config
for FOO=/dev/zero docker compose config
in each of the above reproduction scripts gives the same results. Same errors. The only difference is that, in the successful one, source: /dev/zero
rather than source: /dev/null
, of course.
from compose.
@jolmg hi! I think the issue with the yaml, you should put empty space after ":"
- ${FOO:-/dev/null}: /tmp/foo:to
^ here
from compose.
@idsulik This is the short syntax for volumes.. If I added a space, it wouldn't be a yaml string; it'd a mapping, and I'd get this error:
validating /tmp/docker-compose-interpolation-test-t9H5/docker-compose.yml: services.foo.volumes.0 type is required
Because it's then expecting the different syntax with specific keys.
from compose.
@idsulik Thank you, though. Your comment does show that switching to long syntax is a good workaround for this bug.
d=/tmp/docker-compose-interpolation-test-long-syntax
set -e
mkdir "$d"
cd "$d"
cat > docker-compose.yml <<EOF
services:
foo:
extends: { file: other.yml, service: foo }
EOF
cat > other.yml <<EOF
services:
foo:
image: bash
volumes:
- type: bind
source: \${FOO:-/dev/null}
target: /tmp/foo
read_only: true
EOF
docker compose config
Result:
name: docker-compose-interpolation-test-long-syntax
services:
foo:
image: bash
networks:
default: null
volumes:
- type: bind
source: /dev/null
target: /tmp/foo
read_only: true
networks:
default:
name: docker-compose-interpolation-test-long-syntax_default
from compose.
Related Issues (20)
- [BUG] Cannot pause container - OCI runtime pause failed: unable to freeze: unknown" error_type="*errors.errorString" module=api HOT 2
- [BUG] `exec` command hijacks containers created with `run` HOT 2
- [BUG] depends_on condition does not override correctly HOT 3
- [BUG] Redundant `if` condition in the compose/build.go `toAPIBuildOptions` function HOT 1
- JSON progress writer is missing some event fields
- [BUG] Environment variables not interpreted properly when extending compose file HOT 9
- [BUG] Docker compose volume bind error on remote deployments HOT 1
- [BUG] Build context path is wrong since v2.29.0 on edge cases HOT 4
- [BUG] Double-dollar sign not working anymore for literal dollar sign in command string HOT 4
- [BUG] With multiple Compose files `services[].build.context` is evaluated relative to the first one HOT 5
- [BUG] Incorrect warning about secrets from environment variable being ignored
- [BUG] docker compose produces no output for some commands HOT 2
- [BUG] install failed HOT 1
- [BUG] Weird behavior between orphaned containers and `--remove-orphans` flag HOT 1
- [BUG] Communication in the same docker compose HOT 2
- [BUG] docker-compose does not close unix socket with dockerd after container exits and restarts
- [feature request] Allow hostnames for settings dns.
- [BUG] docker compose exec fails when projectdir is a symlink
- [BUG] `up` incorrectly recreates containers without changes + recreated containers have wrong files inside 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.