Category · 1 tool · 1 guide
Docker tools
Docker packages an application with everything it needs to run into an image that behaves the same on a laptop, in CI and in production. Containers are now the standard unit of deployment for Kubernetes, cloud run services, CI jobs and local development environments, so almost every backend developer ends up writing or maintaining a Dockerfile.
Writing a working Dockerfile is easy; writing a good one takes experience. Copying the whole project before installing dependencies breaks layer caching and slows every build. Shipping compilers in the final image makes it hundreds of megabytes larger than needed. Running as root, forgetting a .dockerignore and leaking build secrets into layers are common security problems that never show up as errors.
The tools in this category generate Dockerfiles that follow current best practices for your stack, with multi-stage builds, cache-friendly ordering, a non-root user and a matching .dockerignore. Generation happens in your browser.
Tools in this category
Common tasks
- Containerise an existing appGenerate a Dockerfile for your language and package manager instead of adapting one from another project.
- Make an image smaller and saferUse multi-stage builds, slim base images and a non-root user, and keep secrets out of layers.
- Deploy the image to KubernetesGenerate a Deployment and Service for the image with probes and resource limits.
- Check a Compose fileValidate and format docker-compose.yml so indentation errors are caught before docker compose up.
- Find the git commands for a release tagTag a commit and push the tag that your image build pipeline uses.
Key concepts
- Image and container
- An image is a read-only template made of layers. A container is a running instance of an image with its own writable layer, process and network.
- Layer caching
- Each Dockerfile instruction creates a layer that is reused if nothing it depends on changed. Copying dependency manifests and installing packages before copying source code keeps rebuilds fast.
- Multi-stage build
- A Dockerfile with several FROM stages. Early stages compile the app with full toolchains, and the final stage copies only the built output into a small runtime image.
- .dockerignore
- A file listing paths the build should not send to Docker, such as node_modules, .git and .env. It speeds up builds and keeps secrets out of images.
- Non-root user
- Containers run as root by default. Switching to an unprivileged user with the USER instruction limits what an attacker can do if the app is compromised.
Best practices
- Pin base images to a specific version tag, and to a digest for critical services, so builds are reproducible.
- Order instructions from least to most frequently changed to get the most out of layer caching.
- Use multi-stage builds so compilers, dev dependencies and source code never reach the final image.
- Run as a non-root user and never bake secrets into the image; pass them at runtime or use build secrets.
- Scan images for known vulnerabilities in CI and rebuild regularly to pick up base image patches.