make command not found in docker container
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
Introduction
If a Docker container says make: command not found, the usual reason is simple: the image does not include make. Containers are often based on minimal images, so build tools that feel "standard" on a developer machine are intentionally absent unless you add them yourself.
Why make Is Missing
A container only contains what the image provides. Many slim or minimal base images omit tools such as make, compilers, package managers, and shells in order to keep the image small and reduce attack surface.
That means this can work on your laptop:
but fail inside the container with:
The fix is not to assume Docker is broken. The fix is to decide whether make truly belongs in that image.
Install make in the Image When You Need It
If the container really should run make, install it in the Dockerfile using the package manager that matches the base image.
For Debian or Ubuntu based images:
For Alpine:
After rebuilding the image, the command becomes available to the container process.
Sometimes You Need More Than make
make is only an orchestration tool. It runs commands listed in a Makefile, and those commands may also require compilers, shells, language runtimes, or headers.
For example, a C build often needs more than just make:
If make becomes available but the build still fails, read the Makefile and identify the actual tools it invokes.
Use Multi-Stage Builds for Cleaner Runtime Images
A common best practice is to keep build tools out of the final runtime image. Install make and related tooling in a build stage, run the build, then copy only the artifacts into the runtime stage.
This keeps the final image smaller and avoids shipping unnecessary build tools into production.
Check Which Image You Are Actually Running
Sometimes the Dockerfile looks correct but the running container still lacks make because you are using an old image or the wrong service definition.
Useful checks:
Inside the container, verify:
That quickly tells you whether the image was rebuilt and which package manager instructions should apply.
Ask Whether make Should Run Inside the Container at All
In some projects, make is just a convenience wrapper for developer workflows. The actual container entrypoint may not need it. For example, a local Makefile might only call docker compose build, docker compose up, or test commands from the host machine.
If the container's job is only to run the built application, installing make there may be unnecessary. The better solution may be:
- run
makeon the host - use Docker only for the application runtime
- keep build tooling in CI or a builder stage
That decision depends on the role of the container, not just on the missing command.
Common Pitfalls
The most common mistake is installing only make when the Makefile actually depends on compilers or other tools. Another is editing the Dockerfile but forgetting to rebuild the image, then debugging a stale container. Developers also sometimes install build tools directly into the final production image when a multi-stage build would keep the runtime image much cleaner.
Summary
- '
make: command not foundusually means the image does not includemake.' - Install it with the package manager for the base image if the container truly needs it.
- Remember that the
Makefilemay also need compilers or other build tools. - Prefer multi-stage builds when
makeis needed only during build time. - Verify you rebuilt and are actually running the updated image.

