Skip to content

Also create docker-compose.yml? #48

Open

Description

@d33tah

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.

Activity

  1. nexdrew commented on Sep 16, 2019

    @nexdrew
    Owner

    @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!

  2. frankhommers commented on Jun 1, 2021

    @frankhommers

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions