diff --git a/README.md b/README.md index e7d97ad..817ce0e 100644 --- a/README.md +++ b/README.md @@ -7,10 +7,23 @@ Required Modules: Example Usage: - sudo python autocompose.py container-name + sudo python autocompose.py + + +Generate a compose file for multiple containers together: + + sudo python autocompose.py apache-test mysql-test + + +The script defaults to outputting to compose file version 3, but use "-v 1" to output to version 1: + + sudo python autocompose.py -v apache-test + + +Outputs a docker-compose compatible yaml structure: -Outputs a docker-compose compatible yaml structure. [docker-compose reference](https://docs.docker.com/compose/) + [docker-compose yaml file specification](https://docs.docker.com/compose/compose-file/) 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). @@ -19,10 +32,13 @@ With this tool, I can easily generate docker-compose files for managing the cont ## Docker Usage -Build container by running: +You can use this tool from a docker container without installing it locally by either building it or using the [automated build on dockerhub.](https://hub.docker.com/r/red5d/docker-autocompose/) + +Build the container by running: docker build -t red5d/docker-autocompose . -Use the new image to generate a docker-compose file from a running container: +Use the new image to generate a docker-compose file from a running container or a list of space-separated container names or ids: + + docker run --rm -v /var/run/docker.sock:/var/run/docker.sock red5d/docker-autocompose ... - docker run -v /var/run/docker.sock:/var/run/docker.sock red5d/docker-autocompose