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

Merge multiple docker-compose files #968

Closed
nathan-K- opened this issue Mar 26, 2018 · 5 comments
Closed

Merge multiple docker-compose files #968

nathan-K- opened this issue Mar 26, 2018 · 5 comments

Comments

@nathan-K-
Copy link

nathan-K- commented Mar 26, 2018

Hey,

First of all, thanks for this great project,
I've run into a very basic issue, when having two docker-compose files, ie:

docker-compose.yml

version: '3'

services:
  server:
    image: test
    container_name: test_server
    build:
      context: .
      dockerfile: Dockerfile-dev
    ports:
      - 3000:3000

docker-compose.prod.yml

version: '3'

services:
  server:
    ports:
      - 5000:5000

With kompose convert -f "docker-compose.yml" -f "docker-compose.prod.yml" , there is :

     - name: "3000"
      port: 3000
      targetPort: 3000
[...]
      spec:
        containers:
        - image: test:dev
          name: test_server
          ports:
          - containerPort: 3000

But nothing about port 5000. (with kompose 1.10.0 (8bb0907), on ubuntu 16.04)

I've seen the PR #312 , but they didn't speak about merging multiple docker-compose files.
Is it planned for a future release ?

Thanks

@nathan-K- nathan-K- changed the title Merge multiple docker-compose file Merge multiple docker-compose files Mar 26, 2018
@hangyan
Copy link
Contributor

hangyan commented Mar 27, 2018

@nathan-K- Yeah.. I think the multiple file support is kind of broken for now. We will trying to fix this ASAP. But about merge thing need a little discus. If docker-compose will merge different files content, may be we should do it too.

@nathan-K-
Copy link
Author

Ok, great !
Yep, they did, in my example a docker-compose -f "docker-compose.yml" -f "docker-compose.prod.yml" up will map ports 3000 and 5000.
It is here in the documentation of docker-compose, if it can help.

@hangyan
Copy link
Contributor

hangyan commented Mar 29, 2018

@nathan-K- Ok, I will check it out.

@hangyan hangyan closed this as completed Mar 29, 2018
@hangyan hangyan reopened this Mar 29, 2018
@noeljackson
Copy link

noeljackson commented Apr 4, 2018

You can simply run this to generate a config to feed to kompose: docker-compose -f docker-compose.yml -f docker-compose.override.yml config > kompose.yml and then run: kompose up -f kompose.yml

@hangyan
Copy link
Contributor

hangyan commented May 3, 2018

close by #990

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants