Matt Davidson bdb38eecac Update autocompose.py
Trying to iterate on cinspect['HostConfig']['PortBindings'] when it is equal to 'None' produces a TypeError
2018-07-15 11:13:38 -04:00
2018-07-15 11:13:38 -04:00
2018-02-12 14:34:25 -05:00
2018-06-27 23:16:48 -04:00

docker-autocompose

Generates a docker-compose yaml definition from a running container.

Required Modules:

Example Usage:

sudo python autocompose.py container-name

Outputs a docker-compose compatible yaml structure. docker-compose reference docker-compose yaml file specification

While experimenting with various docker containers from the Hub, I realized that I'd started several containers with complex options for volumes, ports, environment variables, etc. and there was no way I could remember all those commands without referencing the Hub page for each image if I needed to delete and re-create the container (for updates, or if something broke).

With this tool, I can easily generate docker-compose files for managing the containers that I've set up manually.

Docker Usage

Build container by running:

docker build -t red5d/docker-autocompose .

Use the new image to generate a docker-compose file from a running container:

 docker run -v /var/run/docker.sock:/var/run/docker.sock red5d/docker-autocompose <container-id>
Description
No description provided
Readme 297 KiB
Languages
Python 97.5%
Dockerfile 2.5%