runlike: reconstruct a docker run command from a running container
Given an existing docker container, prints the command line necessary to run a copy of it.
At a glance
- What is it?
- runlike reads a container's configuration and prints the docker run command that would recreate it. It is a recovery tool for containers started by hand or by a configuration management system, and its own README says it should probably not be used in production yet.
- Who is it for?
- runlike fits engineers who inherited a container they did not start and need to see the flags behind it, or who want to replay a container outside Ansible or Chef. It is not for anyone who needs every docker run option reproduced, because the README lists a long set of unsupported flags, and it is not for production automation, which the README itself warns against.
- Can I use it commercially?
- Check first. The repository uses a licence we do not classify automatically, so read its LICENSE file before any commercial use.
- Is it still maintained?
- Yes. The repository last received commits 15 days ago.
- What is it written in?
- Mainly Python, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 19, 2026, and from our analysis. They are not legal advice.
Star history
- lavie/runlike2,960 ★ · +11
| Repository | 2026-09-24 | 2026-11-19 |
|---|---|---|
| lavie/runlike | 2.9k | 3k |
11 Stars in the last 56 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
The container nobody remembers starting
A container is running. It was started months ago by someone who has left, or by a playbook that has since been edited, and the flags that produced it exist only in the container's own configuration. The README opens with exactly this complaint: "See this docker container? I wish I could run another one just like it, but I'll be damned if I'm going to type all those command-line switches manually!"
runlike answers that by reading a container and printing the docker run invocation that would produce a copy, including ports, links and volumes. The audience is narrow and specific: developers and system administrators who deploy containers through a configuration management tool such as Ansible or Chef and then need to re-run one by hand. The README calls it a real time saver for that case, and the framing is honest about the scope. This is a reconstruction tool, not a deployment tool.
How runlike turns container state back into flags
The mechanism is inspection, not interception. runlike takes a container name or ID, reads the container's configuration from the Docker daemon, and maps the fields it finds onto docker run arguments. The pyproject.toml describes the package as reverse-engineering docker run command line arguments based on running containers, which is an accurate one-line summary of the data flow: container config in, command line out.
Two input paths exist. The normal one queries the Docker daemon directly. The second accepts the output of docker inspect piped through --stdin, which matters when the daemon is not reachable from where you are sitting or when you already have an inspect dump saved to a file. That second path is the one to remember during an incident, because a JSON dump travels over SSH and a socket does not.
The mapping is explicit rather than inferred. The README carries a list of supported run options and a second, longer list of options that are not yet supported, with the note that pull requests are welcome. That list is the real specification of the tool's coverage, and it is worth reading before you rely on the output for anything. Anything in the unsupported list is simply absent from the generated command, and the command will still look complete.
Installing runlike and running it against a container
The README gives a pip install and a Docker image. The pip route is the shortest:
pip install runlikeAfter that, pass a container name. The README's example uses a redis container, and the output is a single line you can paste or execute directly:
runlike redisThe README notes that wrapping the call in command substitution, $(runlike container-name), executes the output in one step. Treat that as a convenience for disposable containers rather than a default, since it starts a second container with the same name and will fail on a name collision unless you pass --no-name.
For a readable version, -p breaks the command into one argument per line. The README's redis example produces output in this shape:
runlike -p redisIf you would rather not install anything, the project publishes a Docker image, assaflavie/runlike, and the README shows mounting the Docker socket into it:
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock \
assaflavie/runlike YOUR-CONTAINERThe README also suggests aliasing that invocation in ~/.profile or ~/.bashrc so runlike behaves like a local command. Mounting the socket gives the container full control of the daemon, which is the standard trade-off for tools of this kind and is not something the README discusses. The inspect route avoids that entirely:
docker inspect <container-name> | runlike --stdinA first real use: pick a container you did not start, run runlike -p against it, and read the output line by line against docker inspect on the same container. The gaps show up quickly.
What the output leaves out
The README is unusually direct about this: many docker run options are not yet supported, and the supported list covers the most commonly used ones. The unsupported list includes CPU scheduling flags such as --cpu-shares, --cpus, --cpu-period and --cpu-quota, along with --cgroup-parent, --cidfile and --detach-keys. If a container was tuned with CPU limits, the reconstructed command will run without them. Nothing in the output marks the omission.
That is the failure mode to plan around. A generated command that drops a memory reservation or a CPU quota produces a container that starts and looks correct while behaving differently under load. The README's own advice is to double check that it is actually running what you want it to run, and it states that you probably should not use this in production yet. Take that at face value: the tool is a starting point for a command line, not an authoritative record of one.
There is a second, quieter limitation. Reconstruction depends on what the daemon reports, so anything the daemon does not retain cannot be recovered. The README does not document rollback or any diffing between the original container and the recreated one, so verification is manual work you do yourself.
runlike compared with Rekcod
Rekcod is the closest alternative and appears in the search data around this project. Both tools read a container and emit a docker run command, so the difference is not in the goal but in the implementation and packaging. runlike is Python, installs from PyPI as a single console script, and ships a Docker image built from a Dockerfile that installs a pinned version with pip. Rekcod is a Node.js tool distributed through npm.
That difference decides the choice more often than the output format does. A team with Python in its build images and a pip mirror already configured can add runlike without a new runtime. A team standardized on Node can do the same with Rekcod. The supported flag sets also differ, and neither README claims full coverage, so the practical comparison is to run both against the same container and compare the two command lines. Whichever one reproduces the flags you actually depend on is the one to keep.
Maintenance, releases and the licence question
The last push to the default branch was on 2026-04-27, and the most recent tagged release is v1.6.3 from 2025-02-25, following v1.6.1 and v1.6.0 earlier that year. The repository is not archived. The version in pyproject.toml matches the v1.6.3 tag, so the packaged version and the release line agree.
The project metadata in pyproject.toml declares the licence as MIT, and the classifier list includes the OSI Approved :: MIT License entry. The repository's top-level LICENSE.txt is the file to read for the actual terms, since the metadata field at the top of the repository listing is not a licence identifier. No legal advice here: if you redistribute runlike inside a product or a container image, read LICENSE.txt and confirm it matches the MIT declaration before you rely on it. The Dockerfile installs a pinned runlike version with pip, so an image you build inherits whatever that version's licence says.
Upgrade cost is low by construction. The only runtime dependency declared in pyproject.toml is click, the entry point is a single console script, and the project requires Python 3.8 or newer. There is no daemon, no database and no configuration file to migrate. The cost that does exist is behavioural: a new release can change which flags are emitted, so an upgrade is worth validating against a saved docker inspect dump before you use the new output anywhere that matters.
Editorial conclusion
runlike fits engineers who inherited a container they did not start and need to see the flags behind it, or who want to replay a container outside Ansible or Chef. It is not for anyone who needs every docker run option reproduced, because the README lists a long set of unsupported flags, and it is not for production automation, which the README itself warns against. Before trusting the output, run the printed command with --no-name and diff the result against the original using docker inspect on both containers.
Frequently asked questions
What is runlike in Docker?
runlike is a command line tool that takes an existing Docker container and prints the docker run command needed to start a copy of it, including options such as ports, links and volumes. The README describes it as a time saver for people who deploy containers through a configuration management tool and then need to re-run one manually.
How do I install runlike?
The README gives pip install runlike. If you would rather not install it, the project is also packaged as the Docker image assaflavie/runlike, which the README runs with the Docker socket mounted so it can inspect containers on the host.
Can runlike read a docker inspect dump instead of talking to the daemon?
Yes. The README shows piping the output of docker inspect into the tool with runlike --stdin, which is useful when you have an inspect dump but no direct access to the Docker daemon.
Does runlike reproduce every docker run option?
No. The README states that many docker run options are not yet supported, and it lists both the supported set and the unsupported set, which includes CPU scheduling flags such as --cpu-shares and --cpus. Options outside the supported list are left out of the generated command.
Should runlike be used in production?
The README says you probably should not use it in production yet, and advises double checking that the generated command actually runs what you want it to run. Treat its output as a starting point rather than an authoritative record of the original container.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/lavie-runlike)Star history chart for your README
[](https://hysenlabs.com/projects/lavie-runlike)Was this useful?