TritonDataCenter / sdc-docker

Docker Engine for Triton
Mozilla Public License 2.0
183 stars 49 forks source link

docker-compose #42

Closed cmosetick closed 9 years ago

cmosetick commented 9 years ago

The Triton FAQ states that docker-compose functionality is a work in progress. I thought I would create an issue here to track the status, in case anyone wants to hack on this with me.

Here is what I currently get when pointed to SDC from Mac OS X 10.10 with docker-compose v1.3.1.

The basic WordPress, hello-world example as the compose file:

wordpress:
  image: wordpress
  links:
    - db:mysql
  ports:
    - 80:80

db:
  image: mariadb
  environment:
    MYSQL_ROOT_PASSWORD: example

And here is the output I get when pointed to SDC / Triton container service:

docker-compose up
/usr/local/Cellar/fig/1.3.1/libexec/vendor/lib/python2.7/site-packages/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
Creating wordpresstest_db_1...
Traceback (most recent call last):
  File "/usr/local/Cellar/fig/1.3.1/libexec/bin/docker-compose", line 9, in <module>
    load_entry_point('docker-compose==1.3.1', 'console_scripts', 'docker-compose')()
  File "/usr/local/Cellar/fig/1.3.1/libexec/lib/python2.7/site-packages/compose/cli/main.py", line 31, in main
    command.sys_dispatch()
  File "/usr/local/Cellar/fig/1.3.1/libexec/lib/python2.7/site-packages/compose/cli/docopt_command.py", line 21, in sys_dispatch
    self.dispatch(sys.argv[1:], None)
  File "/usr/local/Cellar/fig/1.3.1/libexec/lib/python2.7/site-packages/compose/cli/command.py", line 34, in dispatch
    super(Command, self).dispatch(*args, **kwargs)
  File "/usr/local/Cellar/fig/1.3.1/libexec/lib/python2.7/site-packages/compose/cli/docopt_command.py", line 24, in dispatch
    self.perform_command(*self.parse(argv, global_options))
  File "/usr/local/Cellar/fig/1.3.1/libexec/lib/python2.7/site-packages/compose/cli/command.py", line 66, in perform_command
    handler(project, command_options)
  File "/usr/local/Cellar/fig/1.3.1/libexec/lib/python2.7/site-packages/compose/cli/main.py", line 460, in up
    do_build=not options['--no-build'],
  File "/usr/local/Cellar/fig/1.3.1/libexec/lib/python2.7/site-packages/compose/project.py", line 230, in up
    do_build=do_build,
  File "/usr/local/Cellar/fig/1.3.1/libexec/lib/python2.7/site-packages/compose/service.py", line 320, in execute_convergence_plan
    do_build=do_build,
  File "/usr/local/Cellar/fig/1.3.1/libexec/lib/python2.7/site-packages/compose/service.py", line 213, in create_container
    number or self._next_container_number(one_off=one_off),
  File "/usr/local/Cellar/fig/1.3.1/libexec/lib/python2.7/site-packages/compose/service.py", line 435, in _next_container_number
    filters={'label': self.labels(one_off=one_off)})
  File "/usr/local/Cellar/fig/1.3.1/libexec/lib/python2.7/site-packages/compose/container.py", line 70, in number
    self.short_id, LABEL_CONTAINER_NUMBER))
ValueError: Container 8c3e583f47 does not have a com.docker.compose.container-number label

docker ps -a
CONTAINER ID        IMAGE               COMMAND                CREATED              STATUS              PORTS               NAMES
8c3e583f47ea        mariadb             "/docker-entrypoint.   About a minute ago   Up 32 seconds       3306/tcp            wordpresstest_db_1

You can see that the mariadb container gets created, and stays up, but the WordPress container is not running, nor even created.

When I run the same WordPress example on a standard Ubuntu 14.04 system with Docker daemon running, both containers are running, and linked properly.

This appears to be a problem with linking containers via docker-compose in SDC. I'm guessing that there is no issue with linking containers via docker run.

dwlf commented 9 years ago

@cmosetick this is a great bug report. Thank you!

Are you able to try your scenario again with Compose 1.2? https://github.com/docker/compose/releases/tag/1.2.0

Based on this and some other feedback we've updated our documentation:

Note: Triton is not compatible with the newly released Docker 1.7 or Docker Compose 1.3. Please use Docker 1.6 and Docker Compose 1.2 when interacting with Triton. https://docs.joyent.com/public-cloud/api-access/docker

We hope to get to a point where we have a live status page showing readiness of triton as each client and api is released.

cmosetick commented 9 years ago

@lloydde Your welcome! I will give Compose 1.2 a try when I have a moment and report back here.

dwlf commented 9 years ago

@cmosetick any success with compose 1.2?

twhiteman commented 9 years ago

Also, us-east-3b (our Beta datacenter which is updated more frequently) does support docker-compose 1.3, if you want to use that: export DOCKER_HOST=tcp://us-east-3b.docker.joyent.com:2376

cmosetick commented 9 years ago

@lloydde Yes, I had success with compose 1.2. It worked great for me.

@twhiteman Thanks for the info on the us-east-3b data center!

I'll close this issue, thanks for your help and suggestions.