All Tools View Categories About Contact Privacy

docker run to Kubernetes YAML Converter

Translate a docker run command into a Kubernetes Pod (and Service) manifest.

Runs entirely in your browser - nothing is uploaded and no cluster connection is made.
0
ports
0
env vars
0
volumes
Your generated Kubernetes YAML will appear here.

About docker run to Kubernetes YAML Converter

You have a docker run command that works locally and now you need it in Kubernetes. The docker run to Kubernetes YAML Converter parses the command and emits an equivalent Pod (and Service) manifest, mapping the common flags to the core/v1 schema.

Paste the command, choose whether to also emit a Service for published ports, and the tool maps image, ports, environment, volumes, working directory, user, restart policy, entrypoint, network, hostname and labels. The leftover tokens become the container command and args.

Names are sanitized to RFC 1123 labels. Everything runs locally and nothing is uploaded.

Features

  • Flag mapping - -p, -e, -v, --name, -w, -u, --restart, --entrypoint, --network, --hostname, --label.
  • Pod + Service - optional Service for published ports.
  • Command/args - trailing tokens become command and args.
  • core/v1 - correct Pod schema.
  • Validation - RFC 1123 names; image required.
  • Copy / Download / Print - get pod.yaml wherever you need it.

How to Use

  1. Paste the docker run command.
  2. Toggle the Service option.
  3. Watch the preview and export.

Examples

Example 1 - web. docker run -d --name web -p 8080:80 nginx:1.27

Example 2 - env. -e FOO=bar

Example 3 - volume. -v /datanswer:/data

Benefits

  • Fast port - docker run to K8s instantly.
  • Valid schema - valid core/v1 Pod.
  • Validated - names and image checked.
  • Clean output - empty fields omitted.
  • Private - everything runs in the browser.
  • Copy, download or print - get the manifest where you need it.

Frequently Asked Questions

What does this converter do?
It parses a docker run command and emits an equivalent Kubernetes Pod manifest (plus a Service when ports are published) so you can run the same container in a cluster.
Which flags are mapped?
-p/--publish, -e/--env, -v/--volume, --name, -w/--workdir, -u/--user, --restart, --entrypoint, --network, --hostname, --label, -d, -it, --rm and the image plus command/args.
How are ports handled?
Each -p HOST:CONTAINER becomes a containerPort (container) and a Service port (host) targeting it.
How is --restart mapped?
always maps to restartPolicy: Always, on-failure to OnFailure, and no/unless-stopped to Never.
Does this connect to a cluster?
No. Everything is assembled in your browser and nothing is uploaded.
Can I download it?
Yes. Copy the YAML, download pod.yaml, or print it.