Dockerfile
A Dockerfile is a text file containing declarative instructions for building a container image and specifying its contents and runtime metadata.
Learn Docker in a Month of Lunches, Second Edition
A Dockerfile is a text configuration file that specifies how to build a Docker container image.
- How it is used
- Automates application packaging into Docker images so containers can run across development and deployment environments.
- How deep it goes
- Works through core instructions, cache-aware ordering, and multi-stage builds, including Java, Node.js, Go, and Windows packaging.
- Examples
- Uses a Node.js web-ping Dockerfile, Java and Go build stages, a Windows MSI installer, and a Go optimization lab.
- What you can do after
- Build it from scratch: write and optimize Dockerfiles that package applications from source into runnable images.
Read how Learn Docker in a Month of Lunches, Second Edition explains Dockerfile →
Build Python Web Apps with Streamlit
A Dockerfile is a text file containing instructions for defining the environment and build steps of a Docker image.
- How it is used
- Defines a portable Streamlit app image for local testing and deployment beyond Streamlit Community Cloud.
- How deep it goes
- Works through image-building instructions, layer caching, secret exclusion, and local testing; leaves multi-container PostgreSQL management outside the procedure.
- Examples
- Uses a Python 3.12 Streamlit app, a complete Dockerfile, and docker build and docker run commands to test it locally.
- What you can do after
- Build it from scratch: write a Dockerfile, exclude secrets, build its image, and run the app in a locally accessible container.
Read how Build Python Web Apps with Streamlit explains Dockerfile →
Road to Kubernetes
A Dockerfile is a text-based configuration file that specifies how to build a container image.
- How it is used
- Defines repeatable instructions for building an application image instead of modifying a running container.
- How deep it goes
- Works through core directives and image builds, while leaving intricate Dockerfile design aside.
- Examples
- Uses an Ubuntu-and-NGINX image, then Python and Node.js application Dockerfiles.
- What you can do after
- Build it from scratch with Dockerfile directives, then build and run a tagged application image using Docker.
Rust Servers, Services, and Apps
A Dockerfile is a text configuration file containing instructions for building a Docker image.
- How it is used
- Packages Rust web services into reproducible Docker images for development testing and production deployment.
- How deep it goes
- Builds a basic image step by step, then covers multistage builds and static musl binaries, without detailing every Docker instruction.
- Examples
- Uses an Actix Web service, Dockerfile-basic, a 1.32 GB image, and a musl-based multistage packaging strategy.
- What you can do after
- Builds and runs a Dockerized Rust web service, then reduces its image footprint with static and multistage packaging.
Read how Rust Servers, Services, and Apps explains Dockerfile →
Kubernetes for Developers
A Dockerfile is a text file containing instructions for building a Docker container image.
- How it is used
- Records application dependencies and configuration as repeatable instructions for building a container image.
- How deep it goes
- Works through Python image construction and Java compilation, then briefly identifies multistage builds without detailing their Dockerfile instructions.
- Examples
- Uses Ubuntu and Python 3 for one Dockerfile and OpenJDK with javac for another, alongside build-and-run commands.
- What you can do after
- Build it from scratch by choosing a base image, adding the application and dependencies, and building the resulting image with Docker.
Google Anthos in Action
A Dockerfile is a text configuration file containing instructions for building a Docker container image.
- How it is used
- Packages migrated VM application content and runtime dependencies into a deployable container image for Kubernetes.
- How deep it goes
- Explains multistage structure, customization points, entry point, image rebuilding, and rolling updates without detailing Docker build internals.
- Examples
- Uses Migrate for Anthos runtime and source-content stages, package-install commands, generated YAML artifacts, and rolling image updates.
- What you can do after
- Apply it by editing generated stages, rebuilding a layered image, and updating the Kubernetes deployment.
Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform
A Dockerfile is a script containing instructions for building a Docker image and specifying its included code and assets.
- How it is used
- Packages a microservice into a Docker image ready for testing, publishing, and deployment.
- How deep it goes
- Explains the instruction sequence and validates image creation with docker build, but does not develop advanced production Dockerfile practices.
- Examples
- Uses a Node.js video-streaming microservice containing source files, npm dependencies, and a sample video.
- What you can do after
- Builds and inspects a tagged Docker image from a project directory using docker build and docker image list.
Build Financial Software with Generative AI (From Scratch)
A Dockerfile is a text configuration file containing instructions for building a container image.
- How it is used
- Defines API and dashboard images that docker-compose.yml builds and runs as application services.
- How deep it goes
- Explains core instructions, build arguments, layers, caching, cleanup, and troubleshooting without detailing Docker internals.
- Examples
- Uses a Python FastAPI API image and a Next.js dashboard image configured with NEXT_PUBLIC_API_URL.
- What you can do after
- Operate/configure containerized API and dashboard builds, then improve rebuild time by ordering cached Dockerfile instructions.
Read how Build Financial Software with Generative AI (From Scratch) explains Dockerfile →
.NET in Action, Second Edition
A Dockerfile is a text file containing instructions for building a Docker container image.
- How it is used
- Specifies how Docker builds a customized .NET service image, especially when built-in container publishing is unavailable or insufficient.
- How deep it goes
- Works through single-stage and multi-stage instructions, file exclusions, and a build command without detailing every Dockerfile instruction.
- Examples
- Uses a .NET service Dockerfile, a .dockerignore file, a tagged `docker build`, and SDK-to-runtime multi-stage variants.
- What you can do after
- Build it from scratch with Docker: configure a .NET service image, exclude local artifacts, and publish into a separate runtime stage.
Read how .NET in Action, Second Edition explains Dockerfile →
Data Pipelines with Apache Airflow, Second Edition
A Dockerfile is a text file containing instructions for building a Docker image.
- How it is used
- Packages task scripts and dependencies into images for DockerOperator execution, or DAG files into an Airflow deployment image.
- How deep it goes
- Works through Dockerfile instructions, building and testing an image, then outlines image publishing and worker execution without detailing Docker internals.
- Examples
- Uses a weather-fetching CLI image, a movie-ratings task image, and an Airflow image that includes DAG files.
- What you can do after
- Build it from scratch: write a Dockerfile for a Python task, build and test its image, and prepare it for DockerOperator use.
Read how Data Pipelines with Apache Airflow, Second Edition explains Dockerfile →
Podman in Action: Secure, rootless containers for Kubernetes, microservices, and more
A Containerfile or Dockerfile is a declarative build file that specifies how to construct a container image and its default runtime metadata.
- How it is used
- Automates repeatable container-image construction and records default behavior for containers launched from the image.
- How deep it goes
- Explains rootfs population, layered RUN execution, runtime directives, and a complete build workflow, but does not detail every directive.
- Examples
- Uses package installation, an HTTP application, context files, podman build, image tagging, pushing, and dangling-image cleanup.
- What you can do after
- Build it from scratch with Containerfile instructions and podman build, then tag, push, inspect, test, replace, or prune images.
AI-Powered Developer: Build software with ChatGPT and Copilot
A Dockerfile is a text-based build specification containing instructions for creating a Docker image.
- How it is used
- Supports the transition from tested application code to locally tested, containerized deployment artifacts.
- How deep it goes
- Defines Dockerfile structure and demonstrates generation, image building, and container execution without detailing advanced optimization.
- Examples
- Uses a Python 3.10 application with main.py, requirements.txt, port 8080, and docker build and docker run commands.
- What you can do after
- Build it from scratch with an AI assistant, review its instructions, create an image, and test the resulting container locally.
Read how AI-Powered Developer: Build software with ChatGPT and Copilot explains Dockerfile →
Kubernetes in Action, Second Edition
A Dockerfile is a text configuration file containing instructions for building a Docker container image.
- How it is used
- Packages an application into a portable container image for local execution and later use with Kubernetes.
- How deep it goes
- Explains base images, file copying, startup commands, image layers, and build output through one minimal example.
- Examples
- Uses a Node.js application with app.js and html files, then demonstrates docker build, docker images, and docker history.
- What you can do after
- Build it from scratch with Docker, tag the resulting image, and inspect its contents and construction history.
Read how Kubernetes in Action, Second Edition explains Dockerfile →
Distributed Machine Learning Patterns
A Dockerfile is a declarative text file containing instructions for building a Docker container image.
- How it is used
- Packages distributed-training code and dependencies into an image used by Kubernetes workers and sequential workflow steps.
- How deep it goes
- Defines a base image, dependency installation, and file copying, then stops short of storage persistence and workflow orchestration.
- Examples
- Uses a Python 3.9 image with pinned TensorFlow packages and a copied multi-worker training script.
- What you can do after
- Builds and imports a tagged training image for execution in a local k3d Kubernetes cluster.
Read how Distributed Machine Learning Patterns explains Dockerfile →
Spring in Action, Sixth Edition
A Dockerfile is a text configuration file containing instructions for building a container image.
- How it is used
- Builds a container image from a Spring Boot application's executable JAR for deployment and execution across container platforms.
- How deep it goes
- Explains a minimal four-instruction Dockerfile line by line and demonstrates Docker build and run commands.
- Examples
- Uses an OpenJDK 11 image, target/*.jar, app.jar, and tacocloud Docker build and run commands.
- What you can do after
- Operate Docker CLI commands to build an image from a Dockerfile and run the packaged application on port 8080.
Read how Spring in Action, Sixth Edition explains Dockerfile →
Machine Learning Platform Engineering
A Dockerfile is a text file containing instructions for building a Docker image and configuring the application environment inside it.
- How it is used
- Packages Python applications and notebook environments into reproducible images for deployment and ML workflows.
- How deep it goes
- Explains Dockerfile instructions, image layers, build arguments, startup behavior, image publishing, and multistage notebook construction.
- Examples
- Uses a Python FastAPI Dockerfile, an Uvicorn entrypoint, Docker build and run commands, and a custom Kubeflow notebook image.
- What you can do after
- Build and run tagged Docker images, publish them to a container registry, and assemble custom Kubeflow notebook images.
Read how Machine Learning Platform Engineering explains Dockerfile →
Quarkus in Action
A Dockerfile is a text-based build specification containing instructions for creating a Docker container image.
- How it is used
- Packages Quarkus applications into Docker or Podman images for cloud-oriented deployment workflows.
- How deep it goes
- Explains generated variants and demonstrates one build and run workflow, without covering Dockerfile instructions exhaustively.
- Examples
- Uses generated JVM, legacy-JAR, native, and native-micro files plus a complete native-micro build-and-run listing.
- What you can do after
- Builds and runs a Quarkus native container image with Maven, Docker build, and Docker run commands.
gRPC Microservices in Go
A Dockerfile is a text-based build specification containing instructions for creating a Docker image.
- How it is used
- Defines service images for Docker Compose tests, local development, and Kubernetes deployment.
- How deep it goes
- Explains multistage Go builds, build context, executable transfer, and image commands, while deferring detailed multistage-build treatment.
- Examples
- Uses separate Order and Payment Dockerfiles with Go builder stages, scratch runtimes, Docker Compose services, and docker build commands.
- What you can do after
- Build service images from Dockerfiles and prepare them for Compose-based tests or Kubernetes deployment.
Related concepts
- container imageproduces · A container image is a packaged filesystem and configuration artifact from which a container can be created and run.
- image layerproduces · An image layer is an immutable filesystem change set that contributes to a layered container image and may be stored, cached, or shared independently.
- Dockerconfigures · Docker is a platform and ecosystem for building, distributing, and running applications in containers.
- containerconfigures · A software container is an isolated execution environment that packages an application and its dependencies while sharing the host operating system kernel.
- base imageuses · A base image is a container image that supplies the initial filesystem and environment from which another container image is built.
- Dockerfile instructionhas part · A Dockerfile instruction is a declarative directive that specifies a build operation or image metadata during container image construction.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

















