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

Also create docker-compose.yml? #48

Open
d33tah opened this issue Sep 16, 2019 · 2 comments
Open

Also create docker-compose.yml? #48

d33tah opened this issue Sep 16, 2019 · 2 comments

Comments

@d33tah
Copy link

d33tah commented Sep 16, 2019

I love this project! Hadn't actually tried out the commands it generates yet, but if it works as expected it'll be a life-saver for me. I have a question though - would it be within the project's scope to also generate docker-compose.yml files? The use case is about being able to migrate small-scale Docker hosts by just dumping the configuration and running it on a different host.

@nexdrew
Copy link
Owner

nexdrew commented Sep 16, 2019

@d33tah Hi 👋 and thanks!

Building in the option to generate YAML output for docker-compose is an interesting idea. I'm not quite sure how much work it will be, but I definitely think it's doable.

Shooting from the hip, I would probably augment the "run object" returned for each container in index.js to include a new property, let's say compose, which would represent an entry for that container in a docker-compose.yml file. I'd probably just create a new function, similar to toRunCommand, that builds the compose object from the inspect object, basically doing the property conversion two different times in two different ways. Then I'd also need a way for the CLI to conditionally output those objects as YAML (though I guess it could just output JSON since YAML is supposed to be a superset of JSON).

Hmm 🤔 I'll give it some more thought. Thanks for the suggestion!

@frankhommers
Copy link

What I do manually, but what probably can be done automatic is drop the output in:
https://www.composerize.com/

The sources of that are here: https://github.com/magicmark/composerize

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

No branches or pull requests

3 participants