TechBuzzPro

Docker Without Container Manager: Storage & Sanity

· 7 min read · Apps & Browsers

In this article
  1. What a Container Manager Actually Does
  2. The Storage Problem with Manual Docker
  3. How a Manager Saves Your Sanity
  4. How to Choose: When to Use a Manager vs. Plain Docker
  5. Common Problems and How a Manager Fixes Them
  6. Costs and Trade-Offs of Using a Manager
  7. Alternatives to Docker Compose
  8. Frequently Asked Questions

Yes, using Docker without a container manager like Docker Compose or Podman Compose can save storage and sanity, but only if you understand what you are giving up. Running containers with plain docker run commands is simpler in the short term, but it leads to orphaned containers, confusing volumes, and manual cleanup that eats disk space and time. A container manager adds a declarative config file that makes your setup reproducible, easier to clean up, and less likely to leave junk behind.

What a Container Manager Actually Does

A container manager (most commonly Docker Compose, now integrated into Docker as docker compose) reads a YAML file that describes your containers, networks, volumes, and environment variables. Instead of typing a long docker run command every time, you write the configuration once and run docker compose up -d to start everything. The manager handles the orchestration: it creates the network, mounts volumes, sets environment variables, and tracks which resources belong to which project.

This matters for storage because every docker run command you execute manually creates a new container layer. If you run the same image multiple times with slight variations, you end up with multiple containers, each taking up disk space. A manager lets you define one service and update it in place, so you do not accumulate duplicates. It also makes cleanup trivial: docker compose down removes the containers and network, and docker compose down -v also removes the named volumes, which is where most of the wasted space hides.

The Storage Problem with Manual Docker

When you use docker run without a manager, you are responsible for tracking every resource. Common storage leaks include:

  • Orphaned volumes: If you create a volume with -v mydata:/data and then delete the container, the volume remains. Docker does not auto-delete volumes unless you use docker volume prune.
  • Dangling images: Pulling a new tag of an image leaves the old one as a dangling image unless you remove it manually.
  • Stopped containers: A container that exits is still on disk, including its writable layer. They accumulate until you run docker container prune.
  • Build cache: Every docker build stores cache layers, which can take gigabytes. Without a manager, you might not realize how much cache is sitting there.

A container manager does not automatically clean these up, but it gives you a single command to tear down a project, and it encourages you to use named volumes that are easy to identify and remove. You still need to run docker system prune occasionally, but you will have far fewer orphaned resources.

How a Manager Saves Your Sanity

The sanity benefit is about reproducibility and documentation. A docker-compose.yml file is a living document of what your app needs. When you come back to a project after six months, you do not have to reconstruct the exact docker run command from your shell history. You just run docker compose up and everything works.

It also helps with team collaboration. Instead of sharing a README with a 10-line command, you share a YAML file. Everyone gets the same ports, volumes, and environment variables. This reduces the classic “works on my machine” problem because the container definition is versioned alongside your code.

Another sanity saver is the ability to manage multiple containers together. A typical web app might have a database, a backend, and a frontend. With plain Docker, you would start three separate containers and manually connect them to a custom network. With Compose, you define all three services in one file, and they automatically join the same network and can reference each other by service name.

How to Choose: When to Use a Manager vs. Plain Docker

You do not need a manager for every use case. Here is a practical breakdown:

  • Use plain docker run when: you are testing a single image quickly, running a one-off command, or debugging something interactively. For example, docker run -it ubuntu bash is fine without a manager.
  • Use a manager when: you are running a service that needs to persist data, has multiple containers, or needs to be restarted after a reboot. If you find yourself writing the same docker run command more than once, it is time to write a compose file.

If you are unsure, start with a manager from the beginning. It is easier to learn Compose than to migrate a messy setup later. Docker Compose is installed with Docker Desktop on Windows and Mac, and on Linux you can install it separately. Podman Compose is an alternative if you prefer Podman over Docker.

Common Problems and How a Manager Fixes Them

One of the most common problems is forgetting to remove a container that uses a specific port. With plain Docker, you might get an error like “port is already allocated.” You then have to find the offending container with docker ps and remove it. With Compose, the manager knows which containers belong to the project, so you can run docker compose down to free the port.

Another issue is environment variable management. In a docker run command, you might have -e DATABASE_URL=... with a long string. If you need to change it, you have to edit the command and re-run it. In Compose, you can use an .env file that Compose reads automatically, so you can change values without touching the YAML file. This also prevents accidentally committing secrets to your shell history.

Volume permissions are another pain point. When you mount a host directory, the container user might not have write access. In a compose file, you can specify the user in the service definition, and you can use named volumes that Docker manages with the correct permissions. This is much easier than debugging permission errors on the command line.

Costs and Trade-Offs of Using a Manager

The main cost is learning curve. Compose adds another layer of abstraction, and its YAML syntax can be intimidating at first. You also have to be careful about version compatibility: not all Docker features are exposed in Compose, though the gap is small for most use cases.

Another trade-off is that Compose can hide what is happening under the hood. If you are debugging a networking issue, you might need to inspect the containers and networks manually, which requires understanding both Docker and Compose. However, the debugging tools are the same: docker logs, docker exec, and docker inspect work regardless of how the container was started.

There is also a slight overhead in file management. You now have a docker-compose.yml file to maintain. But this is usually a net win because it replaces the need to remember complex commands.

Alternatives to Docker Compose

Docker Compose is not the only option. Here are a few alternatives:

  • Podman Compose: Works with Podman, which is a daemonless container engine. It is compatible with Docker Compose files, so you can use the same YAML.
  • Ansible: You can use Ansible to run docker run commands in a controlled way, but it is more of a configuration management tool than a container manager.
  • Kubernetes: For large-scale deployments, Kubernetes is the standard, but it is overkill for a single machine or a small project.
  • Makefile: Some people use a Makefile with targets that wrap docker run commands. This is a lightweight alternative, but it does not give you the same dependency tracking or network management as Compose.

For most personal projects and small teams, Docker Compose is the sweet spot. It is simple enough to learn in an afternoon, and it solves the storage and sanity problems described above.

Frequently Asked Questions

Does using Docker Compose automatically clean up old images and volumes?

No. Compose only manages resources that are defined in the YAML file. When you run docker compose down, it removes containers and networks, but it does not remove images or unnamed volumes. You still need to run docker system prune or docker volume prune to clean up dangling images and unused volumes.

Can I use Docker Compose for a single container?

Yes. Many people use Compose even for a single service because it makes configuration explicit and easy to change. For example, a simple Redis instance can be defined in a compose file with a named volume for persistence, which is easier to manage than a long docker run command.

What is the difference between docker-compose and docker compose?

docker-compose (with a hyphen) is the standalone Python-based tool that was the original. docker compose (with a space) is the plugin that is now integrated into Docker Desktop and Docker Engine. They are mostly compatible, but the plugin version is recommended for new setups because it is maintained as part of Docker.

Will using a container manager slow down my containers?

No. The container manager only runs during the start and stop phases. Once a container is running, it is managed directly by the Docker daemon, so there is no performance overhead. The only difference is that Compose adds a few seconds to the start command because it reads the YAML file and creates the resources.

How do I migrate from plain Docker to Docker Compose?

Start by writing a docker-compose.yml that matches your existing docker run command. You can use the docker inspect command on a running container to see its configuration, then translate that into YAML. Once you have the file, run docker compose up -d to create new containers, and then remove the old ones with docker rm.