Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config --no-interpolate not merging files. #8227

Closed
mellester opened this issue Mar 22, 2021 · 4 comments
Closed

config --no-interpolate not merging files. #8227

mellester opened this issue Mar 22, 2021 · 4 comments

Comments

@mellester
Copy link

mellester commented Mar 22, 2021

Description of the issue

I use docker-compose to merge mutiple configs into one single file
example

docker-compose -f docker/docker-compose.1base.yml  \
-f docker/docker-compose.2reddis.yml \
config > docker-compose.yml 

This works fine

When using

docker-compose -f docker/docker-compose.1base.yml  \
-f docker/docker-compose.2reddis.yml \
config --no-interpolate > docker-compose.yml

I get a output of

ERROR: The Compose file './docker/docker-compose.2reddis.yml' is invalid because:
services.redis.ports contains an invalid type, it should be a number, or an object

Context information (for bug reports)

Output of docker-compose version

docker-compose version 1.28.5, build c4eb3a1f
docker-py version: 4.4.4
CPython version: 3.7.10
OpenSSL version: OpenSSL 1.1.0l  10 Sep 2019

Output of docker version

Client: Docker Engine - Community
 Cloud integration: 1.0.9
 Version:           20.10.5
 API version:       1.41
 Go version:        go1.13.15
 Git commit:        55c4c88
 Built:             Tue Mar  2 20:17:50 2021
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.5
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       363e9a8
  Built:            Tue Mar  2 20:15:47 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.3
  GitCommit:        269548fa27e0089a8b8278fc4fc781d7f65a939b
 runc:
  Version:          1.0.0-rc92
  GitCommit:        ff819c7e9184c13b7c2607fe6c30ae19403a7aff
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Output of docker-compose config
(Make sure to add the relevant -f and other flags)

services:
  redis:
    image: redis:alpine
    ports:
    - published: 6379
      target: 6379
version: '3'

Steps to reproduce the issue

create a file like

#docker-compose.2reddis-copy.yml
version: '3'
services:
    redis:
        image: 'redis:alpine'
        ports:
            - '${FORWARD_REDIS_PORT:-6379}:6379'

run docker-compose -f docker-compose.2reddis-copy.yml config --no-interploate

Observed result

ERROR: The Compose file 'docker-compose.2reddis-copy.yml' is invalid because:
services.redis.ports contains an invalid type, it should be a number, or an object

Expected result

services:
  redis:
    image: redis:alpine
    ports:
    - published: ${FORWARD_REDIS_PORT:-6379}
      target: 6379
version: '3'

Additional information

OS version / distribution, docker-compose install method, etc.
uname -a
Linux DESKTOP-L093T8U 5.4.72-microsoft-standard-WSL2 #1 SMP Wed Oct 28 23:40:43 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

WSL2

@o-sokolova
Copy link

Hi! I want to take this issue.

@o-sokolova
Copy link

o-sokolova commented Apr 7, 2021

This issue refers to #7964 It is not global --no-interpolate mistake. So @mellester please add your 👍 to that issue and I'll continue my investigation there

@stale
Copy link

stale bot commented Oct 30, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Oct 30, 2021
@stale
Copy link

stale bot commented Apr 17, 2022

This issue has been automatically closed because it had not recent activity during the stale period.

@stale stale bot closed this as completed Apr 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants