The published docker-autocompose image mounts the Docker socket and the readme does not mention it
Generate a docker-compose yaml definition from a running container
At a glance
- What is it?
- Red5d/docker-autocompose is a small Python tool that inspects a container you started by hand and writes out a compose file you can keep. Two dependencies, one purpose, and a problem statement written in the first person. The distribution has drifted: three version numbers, an entry point through the package manager, and an importable module named after its own directory.
- Who is it for?
- This fits someone who has lost the command line behind a working container and wants it back in a file, which is exactly the gap the author describes. Check four things.
- Can I use it commercially?
- Not without permission. GitHub finds no licence file in the repository, and without a licence all rights are reserved by default: you may read the code but not reuse it. Check the README, or ask the authors, before using it.
- Is it still maintained?
- Yes. The repository last received commits 120 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 October 4, 2026, and from our analysis. They are not legal advice.
Editorial analysis
Three version numbers, none of them the newest tag
The release history has two entries and the naming convention changes between them. The first is prefixed with a v and is titled First Release, dated 2016. The second has no prefix at all, is numbered one point one, and is dated 2021. The package manifest then declares a third number, one point three, which is not released anywhere. So the newest thing you can install from the release page is two minor versions behind the source tree, and the newest source is nearly five years ahead of that release, with the last commit dated 2026-06-08. The dependencies are pinned with compatible-release ranges, a YAML library and the Docker client, both on a single major version, so a fresh install resolves to what those two libraries publish today rather than to what the code was written against.
The container runs the tool through the package manager on every call
The container definition is short and its entry point is the interesting line. It does not run the program. It runs the package manager with the script name as an argument, and the package manager is installed in a layer below that. The layers are ordered with the entry point declared first and the package manager installed after it, which works because at runtime only the filesystem matters, but it means every single invocation of the image starts a package manager process that resolves a development environment before it reaches your program. The build inside the image also installs the project from source rather than installing a built distribution, so the image carries the layout of a development checkout. That is a defensible choice for a two-dependency utility where build time matters more than start-up time, and it is worth knowing before you put the image in a script that runs often.
The importable module is named after its own directory
The packaging section includes the source directory as the package and maps the command name to a module inside it. Taken literally, that means the console script is an attribute of a module whose name is the literal word src, and the distribution installed into your environment is not called src but declares that src is what it contains. It is an unusual choice and it works, but it has consequences. The import name is not the distribution name, so anything that introspects the installed package to find its module will be confused, and the source tree cannot be reorganised into a conventional nested package layout without changing the console script mapping. The classifier list is otherwise careful: Python 3 only, five interpreter versions from 3.8 to 3.12, POSIX Linux, aimed at system administrators, and marked production stable.
The image expects the host's Docker socket, and that flag has no commentary
Both container examples mount the host's Docker socket into the image before running the tool, and the flag is presented as an ordinary option with no note attached:
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock ghcr.io/red5d/docker-autocompose <container-name-or-id>That socket is the daemon's control interface, and a process holding it can do what a root process on the host can do, so a container given the socket is not confined to reading one container's configuration. The tool needs the API because it inspects a running container, and there is no narrower credential for that, so this is inherent to the approach rather than a mistake. But a reader coming to the flags has no signal that this is the case. The alternative is to install the tool on the host and use the same client library directly, which the readme also supports and does not recommend.
The only testing guidance is that the Compose tool must accept the output
The contributing section is one sentence and it is the most useful instruction in the document. When you change the tool, write the generated output to a file, either of the two filenames the Compose tool recognises, put it in a folder, and run the Compose tool's config command there to check that the file it produces is accepted. That is a complete and checkable acceptance criterion, and it is the right one, because the entire failure mode of this project is emitting a file the Compose tool rejects. What it is not is a test suite. The repository tree has a source directory and no test directory, and the only automation hint is a configuration directory. For a tool whose output must match an external schema, the schema is the specification, and the project correctly points at it twice.
The licence is declared in the metadata and no licence file is in the tree
Two fields in the package metadata declare the same licence: a short form reading version two of the GNU General Public License, and an enumerated classifier reading the same thing in full. The repository's own licence field is unresolved, and the tree contains no licence file at all, which is unusual for a project whose metadata asserts a copyleft licence twice. Copyleft is the part that matters for anyone who wants to modify it: without the licence text in the repository you have to know what version two requires, and without the repository carrying it, a redistribution has nothing to point at. The distribution channels are otherwise well marked: two third-party packages for one Linux distribution are linked, and the readme states in bold that they are provided by a third party and are neither tested nor updated by the maintainers.
It can only report what the daemon still remembers about a container you started by hand
The problem statement is written in the first person and it is the best specification the project has. The author was experimenting with containers pulled from a registry, started several of them with complicated options for volumes, ports, and environment variables, and realised there was no way to remember the commands without going back to the registry page for each image every time a container needed deleting and recreating. That defines both the value and the ceiling. It reconstructs a container's declared configuration, so anything not in that declaration is not recovered, and a container created by an orchestrator rather than by hand will produce a file describing the orchestrator's choices. The compose output defaults to the third version of the file format, with a flag for the first, which is the older of the two formats the tool knows about.
Editorial conclusion
This fits someone who has lost the command line behind a working container and wants it back in a file, which is exactly the gap the author describes. Check four things. Where the compose file will come from, because the tool can only report what the daemon still records, so a container created by an orchestrator will produce something you did not write by hand. How you will run it, because the published image expects the host's Docker socket mounted into it and that is equivalent to giving the container control of the host's daemon. Which version you are installing, because the newest release tag is five years older than the last commit and the package manifest is two minor versions ahead of that tag. And what you are licensing yourself to, because the licence is declared in the metadata and there is no licence text in the tree to read.
Frequently asked questions
What does docker-autocompose do?
It inspects one or more running containers through the Docker API and writes a compose file describing them, so that containers started by hand can be recreated from text. It defaults to the third version of the compose file format and has a flag to emit the first version instead.
How do I run docker-autocompose?
Through the package manager in a local checkout, through a native install the project discourages, through a third-party distribution package it explicitly does not vouch for, or from a published container image. The container examples mount the host Docker socket into the image before running the tool.
What does docker-autocompose need to install?
Two runtime modules, a YAML library and the Docker client, both pinned to compatible-release ranges, plus a package manager to build the project. Its packaging declares Python 3 only, from 3.8 to 3.12, and classifies it as production stable for system administrators on Linux.
How do I check that a generated compose file is valid?
Write the output to a file named docker-compose.yml or docker-compose.yaml and run the Compose tool's config command in the same folder. The contributing guide names that as the validation step for any change to the script, and it is the only verification guidance the project gives.
What is the latest version of docker-autocompose?
The release page's newest tag is 1.1, dated 2021, and the earlier one is prefixed with a v. The package manifest declares 1.3.0, which is not released, and the last commit to the repository is dated 2026-06-08, so the source is well ahead of anything published.
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/red5d-docker-autocompose)