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

Multiple compose files seems to be broken #1048

Open
Uelb opened this Issue Jul 9, 2018 · 5 comments

Comments

Projects
None yet
4 participants
@Uelb

Uelb commented Jul 9, 2018

Hi,

I'm trying to convert 2 different compose files :

# docker-compose.yml
version: '2'
services:
  app:
    command: script/run.sh
    ports:
      - 3000
  nginx:
    image: nginx
    volumes_from:
      - app
    depends_on:
      - app

And

# docker-compose.production.yml
version: '2'
services:
  app:
    build:
      context: .
      dockerfile: Dockerfile.prod
    image: my_image
    volumes:
      - ./file_storage:/app/public/system/
      - assets:/app/public/assets/
    environment:
      PASS: ${PASS}
  nginx:
    ports:
      - 80
    volumes:
      - ./nginx.production.conf:/etc/nginx/conf.d/default.conf
volumes:
  assets:
networks:
  nginx_default:
    external: true

I have an error when running :

kompose convert --stdout -f docker-compose.yml -f docker-compose.production.yml

ERRO Could not parse config for project members : Service 'app' has neither an image nor a build context specified. At least one must be provided.
FATA composeObject.Parse() failed, Failed to load compose file: Service 'app' has neither an image nor a build context specified. At least one must be provided.

It seems like the docker-compose version takes priority and that the docker-compose production yml is not read. When I change the order of the -f options, I have a similar error with the nginx service having no build context.

My kompose version is 1.15.0 (e3cd4d4).
My OS is MAC OS High Sierra (10.13.14)

When using docker-compose cli, I successfully can run this configuration with docker-compose -f docker-compose.yml -f docker-compose.production.yml up

I have trouble understanding why it does not work correctly.

@Uelb

This comment has been minimized.

Uelb commented Jul 9, 2018

Actually, I just saw this issue : #968

It seems like what I'm looking for is not a supported feature right ? "Multiple docker-compose files" is supported but not by merging them ?

@hangyan

This comment has been minimized.

Member

hangyan commented Jul 10, 2018

@Uelb I think PR #990 have fix this, but it seems have some bugs, i will check it again.

@Uelb

This comment has been minimized.

Uelb commented Jul 10, 2018

Thank you !

@fejta-bot

This comment has been minimized.

fejta-bot commented Oct 8, 2018

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@fejta-bot

This comment has been minimized.

fejta-bot commented Nov 7, 2018

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment