Converting a docker run Command into docker-compose Format

docker command convert to docker-compose format

* This page contains promotional content

When you use DockerHub , you see instructions written in the style of “run docker run … to start it”, don’t you.

And then there are many occasions where you want to fold that docker run … into docker-compose.

If you are used to YAML or TOML in the docker-compose format, you can simply write the version, put down the service name and then fill in the contents of the service, but lining up the indentation and so on really is a hassle.

For times like that, there are handy services and programs published that convert into this format.

composerize.com

It is an online service, so as long as you have a browser you can convert anywhere, which makes it convenient

Just enter the docker run command in the form and it is converted into the Output box instantly

Github

composerize Here the composerize program itself is published on Github, so if you want to do the conversion yourself, you can build it and produce an executable so that you can work offline as well