mauricioklein / docker-compose-api

A Docker Compose parser for Ruby
MIT License
33 stars 25 forks source link

Support dockerfile key and env vars in compose file #39

Closed autotelik closed 7 years ago

autotelik commented 7 years ago

Hi @mauricioklein

This PR adds support for a couple of features

1) A named dockerfile in a compose file, for example

test-rest-server:
  build: .
  dockerfile: Dockerfile-test-rest

2) Specifying environment variables in a compose file.

The yaml is parsed after loading, replacing any found tags which match the compose env variables format ('${name}'), with real values taken from ENV

This is first PR I've raised for someone else's open source project so I hope the level of detail ok

Thanks tom

autotelik commented 7 years ago

@mauricioklein are there any issues with this PR ?

mauricioklein commented 7 years ago

Sorry @autotelik got no chance to check your PR yet. Will let you know once I'm able to. Thanks for your contribution!

autotelik commented 7 years ago

@mauricioklein .. Hi! no problem - actually my first PR on someone else's project so was just worried I hadn't sent it to you properly

no worries, thanks for a great project, worked really well

sergeyklay commented 7 years ago

@mauricioklein is there a chance that it will be accepted? We still wait for https://github.com/zuazo/dockerspec/issues/6 fix

mauricioklein commented 7 years ago

@autotelik

First of all, thanks for your contribution. Considering my lack of time to evolve the project on the last months, the community help is really appreciated :+1:

Besides your implementation seems correct and address an existing functionality to Docker Compose, the object support for the build attribute was added since version 2 of Docker Compose file.

Since this gem was initially developed on basis of v1, this new functionality will break back compatibility.

I suggest to postpone your PR after a major refactoring I'm planning.

As you might have realized, this gem was developed initially when I was learning Ruby, so there's a lot of technical debts that need to be paid and, one of the majors, is the versioning of the features.

Once we got the division of versions on the gem, your PR will be much appreciated.

Thanks again for your support and hope you understand this decision.

autotelik commented 7 years ago

@mauricioklein no worries, hope its useful. use docker quite heavily so happy to try to contribute if you want help on anything specific