Skip to content
This repository has been archived by the owner on Jan 5, 2023. It is now read-only.

Is it possible for docker-compose-api and docker-compose to co-operate? #29

Open
CpuID opened this issue Apr 30, 2016 · 6 comments
Open

Comments

@CpuID
Copy link
Contributor

CpuID commented Apr 30, 2016

Currently if you spin up your infrastructure using docker-compose-api, and try to stop or rm it with docker-compose after, nothing occurs and the containers remain running.

Should the two be able to co-exist and act on the same set/s of containers? or can they only operate independently? Being that both do not run persistently or maintain any state files, I would assume there's an inconsistency between the two projects of some sort preventing it at the moment?

docker-compose version: 1.6.2

@xeger
Copy link

xeger commented May 4, 2016

You may find some guidance by looking at https://github.com/docker/libcompose -- which is Docker Inc's first step at rewriting Docker Compose in golang. (Presently it's a Python app that is distributed as a monolithic binary.)

Between the Python and the golang implementation, you can infer a "spec" that will allow your Ruby implementation to interop with the other to. I believe containers that represent running services are identified by a naming pattern (i.e. myproject_myservice_1); there may be labels on the containers too.

I'm the author of the docker-compose gem and I took the brutish but effective approach of just wrapping the docker-compose CLI. Your approach is more elegant, but of course it's more work. What you're really building is libcompose-ruby if you want to think of it that way. Unlike docker-api, you do not target Docker Compose's API (it has none; just a CLI). Rather, you are providing an independent reimplementation in Ruby...

@mauricioklein
Copy link
Owner

I don't remember, from the top of my mind, any reason why a container started with this gem can't be deleted/removed by Docker client itself.

Anyway, I'll check it out and give you guys a feedback...

Thanks for the issue report!

@CpuID
Copy link
Contributor Author

CpuID commented May 22, 2016

+1 to Docker going down the road of rewriting docker-compose in Golang, thanks for the reference @xeger :) Considering so many of their other tools are already Golang, makes sense from a code reuse standpoint.

I am very close to considering the docker-compose gem at the moment but I believe there was some piece of missing functionality when I looked a week ago, I'll check into what it was and report back also.

@CpuID
Copy link
Contributor Author

CpuID commented May 22, 2016

@xeger found the two things I am missing, created issues for each on the other gem repo:

xeger/docker-compose#19
xeger/docker-compose#20

@rgarbin
Copy link
Contributor

rgarbin commented Jun 13, 2016

+1

Is there a REST api for Compose?

On docker project has an open issue about it, take a look!
docker/compose#230

@arturschuch
Copy link

+1

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

No branches or pull requests

5 participants