docker-archive / dockercloud-cli

CLI for Docker Cloud
https://cloud.docker.com/
Apache License 2.0
74 stars 40 forks source link

export stack file from Docker Cloud #16

Closed anas-aso closed 8 years ago

anas-aso commented 8 years ago

I exported the current running stackfiles from Docker Cloud account and I got a file with all the indentations missed up

tifayuki commented 8 years ago

@anas-aso Which OS are you on? I tested it on both OS X and Ubuntu, and it works fine.

anas-aso commented 8 years ago

@tifayuki I'm using OS X 10.11.3 (15D21) I wanted to try it again now and I got this famous error message :

$ docker-cloud stack ls
Status 429 (GET https://cloud.docker.com/api/tutum/v1/auth/). Response: {"detail": "Too many login attempts."}
fermayo commented 8 years ago

@anas-aso can you please provide the exported docker-compose that you get?

anas-aso commented 8 years ago

@fermayo there is nothing special about it, but here it is :

lb:
  image: 'dockercloud/haproxy:1.0.1'
  autoredeploy: true
  links:
    - web-site
  ports:
    - '80:80'
    - '443:443'
  restart: always
  roles:
    - global
  sequential_deployment: true
web-site:
  image: 'tutum/hello-world:latest'
  autoredeploy: true
  restart: always
  sequential_deployment: true

and this is what I got after exporting it from Docker Cloud

lb:
  autoredeploy: true
  image: dockercloud/haproxy:1.0.1
  links:
  - web-site
  ports:
  - 80:80
  - 443:443
  restart: always
  roles:
  - global
  sequential_deployment: true
web-site:
  autoredeploy: true
  image: tutum/hello-world:latest
  restart: always
  sequential_deployment: true

You see here that the indentation was missed up for links, ports and roles values and this is the docker-cloud version I'm using :

$ docker-cloud --version
docker-cloud 1.0.1
fermayo commented 8 years ago

So that indentation meets the YAML spec, so should work everywhere. Do you have any problem loading that?

anas-aso commented 8 years ago

yeah, you are right. Actually I have a local setup where I test stack files with docker-compose before pushing them to Docker Cloud (of course all docker cloud related service configuration are removed before) and for some reason docker-compose was complaining about this indentation which is not the case anymore. I'm not sure if this has something to do with docker machine on OS X or not, but it seems like the issue disappeared after a reboot ! Anyway, thanks for following with me. I will close this issue now

fermayo commented 8 years ago

Thanks for letting us know :)