Closed egeldenhuys closed 6 years ago
Most relevant files from Swarmpit that I could find. @devosray are you familiar with Clojure?
Basically they map Docker inspect output to an intermediate model
Some useful tools:
Note that I have not done any further work on this issue
I found a python version that works for containers: https://github.com/Red5d/docker-autocompose
EDIT: only works for v1 compose files
Could you maybe explain the relevance of fury-cli? Could you maybe explain how it helps with this task?
Fury converts the swagger.yml
to a blueprint.apib
which contains JSON Schemas.
The Schema can then be converted into a TypeScript interface (and probably a relevant structure for JavaScript). I guess this is more relevant to TypeScript since in JavaScript we welcome run time errors
npm package that might be of interest:
I think it will be better to fork this project (if we need to modify it) than to create our own package
The npm package repo: https://github.com/TripleParity/docker-api-to-compose
Implemented by https://github.com/TripleParity/docker-api-to-compose.
Open related issues on that repo
Given a stack name it should be possible to generate a working
docker-compose.yml
file.This may require first discovering all services that are part of the given stack, and reverse each one of them individually. I think Swarmpit already does this, so we can have a look at how they are doing it.
If we can reverse a service into a model we can also use this in the UI for populating forms.
docker inspect
outputWe do not need to convert from stack file to the model, since we will give the stack file directly to the Docker API.
I made this a separate issue as it is probably the most complex part of the system so far