Description of the issue
When trying combine compose and override files with docker-compose config --no-interpolate, I get an validation error in the ports block for a service that uses environment variables.
Context information (for bug reports)
Output of docker-compose version
docker-compose version 1.25.0, build unknown
Output of docker version
Docker version 19.03.8, build afacb8b7f0
Output of docker-compose config
(Make sure to add the relevant -f and other flags)
The issue relates to config!
Steps to reproduce the issue
- Small example file
#compose.yml
version: '3'
services:
test:
image: hello-world
ports:
- "${DUMMY_PORT}:${DUMMY_PORT}"
docker-compose -f compose.yml config --no-interpolate
Observed result
services.test.ports is invalid: Invalid port "${DUMMY_PORT}:${DUMMY_PORT}", should be [[remote_ip:]remote_port[-remote_port]:]port[/protocol]
Expected result
version: '3'
services:
test:
image: hello-world
ports:
- "${DUMMY_PORT}:${DUMMY_PORT}"
Stacktrace / full error message
compose.config.config.find: Using configuration files: ./compose.yml
ERROR: compose.cli.main.main: The Compose file './compose.yml' is invalid because:
services.test.ports is invalid: Invalid port "${DUMMY_PORT}:${DUMMY_PORT}", should be [[remote_ip:]remote_port[-remote_port]:]port[/protocol]
Additional information
OS version / distribution, docker-compose install method, etc.
Pop! OS 20.04, using system packages for docker / docker-compose.
Description of the issue
When trying combine compose and override files with
docker-compose config --no-interpolate, I get an validation error in theportsblock for a service that uses environment variables.Context information (for bug reports)
Output of
docker-compose versionOutput of
docker versionOutput of
docker-compose config(Make sure to add the relevant
-fand other flags)The issue relates to config!
Steps to reproduce the issue
docker-compose -f compose.yml config --no-interpolateObserved result
services.test.ports is invalid: Invalid port "${DUMMY_PORT}:${DUMMY_PORT}", should be [[remote_ip:]remote_port[-remote_port]:]port[/protocol]Expected result
Stacktrace / full error message
Additional information
OS version / distribution,
docker-composeinstall method, etc.Pop! OS 20.04, using system packages for docker / docker-compose.