代码、数据与二维码工具

Docker运行转DockerCompose转换器

在浏览器中处理或呈现Docker运行转DockerCompose转换。

优先本地处理无需注册隐私说明 ↗

Paste one docker run command. Common ports, environment variables, volumes, restart, network, hostname, workdir, entrypoint, and command options are supported.

使用步骤

如何使用

  1. Paste one docker run command, including options such as ports, environment variables, volumes, and a name.
  2. Convert it and review the generated Compose YAML plus any unsupported flags.
  3. Copy the YAML or download it as compose.yaml.

Common Docker options

The converter understands detached mode, container names, port mappings, environment variables, volumes, restart policies, networks, hostnames, work directories, and the remove flag. The image is required.

Review before running

Docker has many flags and shell grammars. Unsupported options are listed after conversion so you can confirm the YAML before using it. Conversion happens entirely in your browser.

常见问题

你可能还想知道

Does this run Docker?

No. It only translates text into Compose YAML; review and run the result yourself.

Which flags are supported?

Common flags include --name, -p/--publish, -e/--env, -v/--volume, --restart, --network, --hostname, --workdir, --rm, and --entrypoint.

Can I paste a shell script?

Paste one docker run command. Shell quoting is handled for common quoted values, but complex shell expansion should be reviewed manually.