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

Error to parse docker-compose v3 format #412

Closed
pivulic opened this issue Feb 5, 2017 · 13 comments
Closed

Error to parse docker-compose v3 format #412

pivulic opened this issue Feb 5, 2017 · 13 comments

Comments

@pivulic
Copy link

pivulic commented Feb 5, 2017

Problem

When trying to create named volumes that can be reused across multiple services (without relying on volumes_from due to "PersistentVolumeClaim is not bound"), kompose is unable to parse docker-compose.yml version 3 format.

See: https://docs.docker.com/compose/compose-file/#/volume-configuration-reference

How To Recreate

  1. Create file:touch docker-compose.yml

  2. Copy/paste:

    version: "3"
    services:
      db:
        image: db
        volumes:
          - data-volume:/var/lib/db
      backup:
        image: backup-service
        volumes:
          - data-volume:/var/lib/backup/data
    
      volumes:
        data-volume:
    
  3. Run: kompose up -f docker-compose.yml

Actual Result

ERRO Could not parse config for project test : yaml: unmarshal errors:
  line 1: cannot unmarshal !!str `3` into config.RawService
FATA Failed to load compose file: yaml: unmarshal errors:
  line 1: cannot unmarshal !!str `3` into config.RawService

Expected Result

docker-compose.yml should successfully be converted and deployed.

@procrypt
Copy link
Contributor

procrypt commented Feb 6, 2017

@pivulic Kompose does not support docker-compose version 3 yet.

@michaelharrer
Copy link

when will it be available? (roundabout)

@cdrage
Copy link
Member

cdrage commented Feb 6, 2017

@surajssd Hey man, do you know if this will be updated upstream in libcompose?

@cdrage
Copy link
Member

cdrage commented Feb 6, 2017

Ahhhh, just found the issue: docker/libcompose#421

We'll have to wait for this to be updated upstream @michaelharrer @pivulic

@surajssd
Copy link
Member

surajssd commented Feb 9, 2017

yeah v3 is still WIP in upstream and I guess once that is done we can move to it.

@cdrage
Copy link
Member

cdrage commented Feb 9, 2017

@michaelharrer @pivulic

The best way to "workaround" this is simply removing the "deploy" section of your V3 file and changing the v3 value to v2 and it'll work fine. Luckily there aren't any too major changes between the versions :)

@pivulic
Copy link
Author

pivulic commented Feb 9, 2017

What "deploy" section? :) The reason why I'm trying the v2 version, is to be able to use named volumes, instead of using volumes_from, trying to get around the "PersistentVolumeClaim is not bound") issue.
But I'm going to try and create the Persistent Volume in my cluster before running kompose up (using a v2 docker-compose.yml), as you recommend in #411 (comment) :)

@cdrage
Copy link
Member

cdrage commented Feb 9, 2017

@pivulic Ahhhhh. I got my facts wrong. I thought the only large difference was the deploy section of v3. They added named volumes too! We'll see what we can do to fix it. Funny enough, another issue was just opened in regards to using underscores and such in volume names (bug), we could possibly fix two issues with one PR :)

@cdrage
Copy link
Member

cdrage commented Mar 6, 2017

I'm labeling this as a bug with libcompose as this will need to be supported upstream as well as downstream within Kompose.

@surajnarwade
Copy link
Contributor

@surajssd @kadel , can you please add compose v3 label here ?

@cdrage
Copy link
Member

cdrage commented Apr 26, 2017

@surajnarwade done

@cdrage
Copy link
Member

cdrage commented Jun 15, 2017

@pivulic #600 has now been merged! 🎉 🎉 🎉

@cdrage cdrage closed this as completed Jun 15, 2017
@pivulic
Copy link
Author

pivulic commented Jun 15, 2017

Wohoo!

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

No branches or pull requests

6 participants