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

Support for docker-compose version 2 #5

Open
andreaskoch opened this issue Nov 3, 2016 · 4 comments
Open

Support for docker-compose version 2 #5

andreaskoch opened this issue Nov 3, 2016 · 4 comments

Comments

@andreaskoch
Copy link

I just wanted to try compose2bash but it seems that it currently does not support docker-compose files in version 2:

error parsing docker-compose.yml yaml: unmarshal errors:
  line 1: cannot unmarshal !!str `2` into main.Service

Do you have any plans on adding support for version 2?

@maxcnunes
Copy link
Member

Could you please provide an example of your docker-compose.yaml file?

@andreaskoch
Copy link
Author

I guess you can take any example from the docker website (see: docs.docker.com/compose/compose-file/#version-2) but here is the one I tried to convert with compose2bash:

version: '2'

services:
  web:
    image: nginx:1-alpine
    volumes:
      - ./config/nginx/conf.d:/etc/nginx/conf.d:ro
      - ./config/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
    volumes_from:
      - phpfpm:ro
    networks:
      - front
      - back
    labels:
      - "traefik.port=80"
      - "traefik.frontend.rule=Host:wambo.co,www.wambo.co"
      - "traefik.protocol=http"
      - "traefik.frontend.entryPoints=http,https"
      - "traefik.frontend.passHostHeader=true"

  phpfpm:
    image: php:7-fpm-alpine
    volumes:
      - ./web:/var/www/html
    networks:
      - back

networks:
  front:
    driver: bridge
  back:
    driver: bridge

@maxcnunes
Copy link
Member

Sorry, right now I have not time and need to add support for the version 2. But I would gladly accept a PR for that.

@tcler
Copy link

tcler commented Dec 29, 2018

JFYI: encountered a similar problem:

'''
$ compose2bash-linux_amd64 -yml docker-compose.yml -app pnfs-community
2018/12/29 15:12:47 error parsing docker-compose.yml yaml: unmarshal errors:
line 5: cannot unmarshal !!str 2.1 into main.Service
'''

will try to fix it

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

3 participants