Skip to content
Marvin's Toolbox.

Docker Run to Compose Converter

Turn docker run commands into a docker-compose.yml, or a compose file back into docker run. Ports, volumes, environment variables, networks, restart policies and resource limits carry over.

Runs entirely in your browser. Nothing you put in here gets uploaded.

Convert

Options

Defaults to --name or the image name.

Ports and volumes

Compact strings like 8080:80.

Notes

  • -d has no compose key. Run docker compose up -d to start the services in the background.

Next steps

Keep going. These tools open with your result loaded in.

Convert text into every case at once: title case in the APA, AP, Chicago, MLA, Bluebook, AMA and NYT styles, sentence case, upper, lower, camelCase, snake_case, kebab-case and more.

Count words, characters, sentences, paragraphs, lines and more as you type, with estimated reading and speaking time.

Remove duplicate lines from a list or text, keeping the first occurrence. Optionally ignore case and whitespace, or drop blank lines too.

Replace text in two modes: plain find and replace all, or regular expressions with flag controls and capture group references like $1.

Compare two texts and see every added, removed and changed line highlighted, side by side or inline, with the changed words marked within each line. Ignore case, whitespace or blank lines, read a summary of how much changed, and export the result as a unified diff.

Paste a UUID to see what it carries: version, variant, and for time-based versions the exact timestamp, clock sequence and node. Also shows the raw bytes, the 128-bit integer and the URN form.

Decode Base64 to text or encode text to Base64. Paste into the top box, read the result below, and flip the direction with one click. Handles Unicode correctly, reads URL-safe Base64, and shows binary payloads as a hex dump you can download.

Convert numbers between binary, octal, decimal, hexadecimal and any base up to 36. Type into any field and the others update as you go. Handles huge integers without losing precision and accepts 0x, 0b and 0o prefixes.

Convert between scientific notation and full numbers as you type. Reads 1.23e5, 1.23 × 10^5 and plain numbers, shows the value written out, in normalized scientific notation and in engineering notation, and can round to any number of significant digits.

About the Docker Run to Compose Converter Tool

This tool turns docker run commands into a docker-compose.yml file, and a compose file back into docker run commands. Paste a command copied from a README or your shell history and the compose service appears as you type.

Quotes, backslash line breaks and several commands at once are all understood. Each command becomes its own service, and named volumes and networks get their own top-level blocks. Flags that have no compose equivalent, like --rm or -d, show up as notes instead of disappearing without a word.

What you can do

  • Convert a docker run command to docker compose
  • Turn several docker run commands into one compose file
  • Convert a docker-compose.yml back into docker run commands
  • Convert podman run commands to a compose file
  • Pick short or long syntax for ports and volumes
  • Download the result as docker-compose.yml or a shell script

How to use the Docker Run to Compose Converter

  1. 1Pick the direction with the Run to Compose or Compose to Run tab.
  2. 2Paste your docker run commands or your compose file on the left.
  3. 3Adjust the options, like the service name or the port and volume syntax.
  4. 4Read the notes for anything that could not carry over, then copy or download the result.

What carries over

Ports, volumes and --mount, environment variables and env files, labels, restart policies, networks with aliases and fixed IPs, the entrypoint and command, health checks, logging, memory and CPU limits, ulimits, sysctls, capabilities, devices, DNS settings, extra hosts and GPU access all map to their compose keys. Interactive flags like -it become stdin_open and tty.

A user-defined network in a docker run must already exist, so it is marked external in the compose file. If the same paste also holds the docker network create line, the network is left for compose to create instead.

Dollar signs and the working directory

Compose reads $VAR the same way the shell does, so a variable you would expand in the shell stays a variable. A literal dollar sign, like one inside single quotes in a password, is written as $$ so compose keeps it as is.

A bind mount from $(pwd) or $PWD becomes a path relative to the compose file, like ./data. Going the other way, relative paths become "${PWD}/data" so the command works from the folder the compose file lives in.

Compose to run

Pick one service or convert them all. Every command starts with -d by default, since that is how compose runs services, and any network the services need gets a docker network create line first. Keys that only make sense to compose, like depends_on or build, are listed as notes.

Tools that share a tag with this one.

Convert config and data between JSON, YAML, TOML, JSON5, INI, XML, CSV and .env. Type or paste on the left, pick the output format on the right, and copy the result. Includes a format button and a minify toggle.

Encode and decode Base16, Base32, Base36, Base45, Base58, Base62, Base64 and Base85. Pick the alphabet variant you need, from Crockford Base32 to Bitcoin Base58 and Ascii85, and convert in either direction.

Decode Base64 to text or encode text to Base64. Paste into the top box, read the result below, and flip the direction with one click. Handles Unicode correctly, reads URL-safe Base64, and shows binary payloads as a hex dump you can download.

Format code in JavaScript, TypeScript, JSON, JSON5, HTML, Vue, CSS, SCSS, LESS, Markdown, YAML, GraphQL, XML and SQL. Pick tabs or spaces, set the indent width, and format the input in place with one click.

Convert a color between HEX, RGB, HSL, HSV, HWB, CMYK, OKLCH and OKLAB. Type into any field and the others update as you go, or pick the color visually. Reads CSS color syntax and keeps alpha where the format supports it.

Convert between px, rem, em, percent, pt and viewport units with a configurable root font size. Type into any field and the others update as you go, set the parent font size for em math, and read a conversion table for common sizes.