1. [Home](<https://delaparra-services.nl/>) 
1. [Knowledge hub](<https://delaparra-services.nl/knowledge-hub>) 
1. [build](<https://delaparra-services.nl/knowledge-hub/build>)

  

Category: Docker 

# build

  Explained by [Reinier de la Parra](<https://delaparra-services.nl/about>)  Updated November 25, 2026    

## What is build?

 

build: Tells Compose to build an image from a Dockerfile instead of pulling one. Can point at a context and a specific Dockerfile. In Docker Compose, the ` build ` key tells Compose to build an image from a Dockerfile instead of downloading one. You can set the build context, the Dockerfile name and build arguments.

 

Definition source [Coders Lingo](<https://coderslingo.com/resources/open-dataset/>), [CC BY 4.0](<https://creativecommons.org/licenses/by/4.0/>)

 

## Frequently asked questions about build

  

### How is build used in practice?

 

This is typical for your own application, while services like MySQL and Redis use ` image ` to pull an official image. ` docker compose up --build ` rebuilds before starting, which you need after changing the Dockerfile or dependencies.

    

### What should you keep in mind with build?

 

Keep the build context small. Compose sends the whole context folder to the builder, so add a ` .dockerignore ` that excludes ` node_modules `, ` vendor `, ` .git ` and log files. That makes builds faster and stops secrets in local files from ending up in an image. You can combine ` build ` and ` image ` to give the built image a name and tag.

    

### What does an example of build look like?

 

```
services: web: build: context: . dockerfile: Dockerfile args: VERSION: "1.0"
```

 

## At a glance

   CategoryDocker Explained by[Reinier de la Parra](<https://delaparra-services.nl/about>) UpdatedNovember 25, 2026

 

## More Docker terms

 

- [base image](<https://delaparra-services.nl/knowledge-hub/base-image>) 
- [bind mount](<https://delaparra-services.nl/knowledge-hub/bind-mount>) 
- [bridge](<https://delaparra-services.nl/knowledge-hub/bridge>) 
- [CMD](<https://delaparra-services.nl/knowledge-hub/cmd>) 
- [container](<https://delaparra-services.nl/knowledge-hub/container>) 
- [container DNS](<https://delaparra-services.nl/knowledge-hub/container-dns>)

 

[All terms starting with B](<https://delaparra-services.nl/knowledge-hub#letter-b>)

 

## Skills

 

- ### Docker Build Strategies

 

Use this skill when writing, reviewing, or optimizing Dockerfiles, even if the user just says their image is too large, their build is slow, or they need to harden a container for production. Covers multi-stage builds, layer caching, .dockerignore, non-root users, and image size optimization.

 [View skill](<https://delaparra-services.nl/skills/docker-build-strategies>) [Download zip](<https://delaparra-services.nl/skills/docker-build-strategies/download>) 
- ### Multi Stage Dockerfile

 

'Create optimized multi-stage Dockerfiles for any language or framework'

 [View skill](<https://delaparra-services.nl/skills/multi-stage-dockerfile>) [Download zip](<https://delaparra-services.nl/skills/multi-stage-dockerfile/download>) 
- ### Docker Project Foundations

 

Use this skill when setting up, initializing, or Dockerizing a project, even if the user doesn't explicitly mention Docker but describes a need for containerized local development, adding a database or cache dependency, or running services without host-level installs. Covers Dockerfile, compose.yaml, and .dockerignore creation with Docker best practices.

 [View skill](<https://delaparra-services.nl/skills/docker-project-foundations>) [Download zip](<https://delaparra-services.nl/skills/docker-project-foundations/download>)

 [Download all skills (zip)](<https://delaparra-services.nl/knowledge-hub/build/skills.zip>)

 

## Manuals

 

- [Docker for your Laravel app](<https://delaparra-services.nl/manuals/docker-voor-je-laravel-app>)

 

## Related services

 

- [Custom software and web applications](<https://delaparra-services.nl/services#service-03>)

Perhaps your customers need somewhere to download their invoices, or your staff are managing bookings in a spreadsheet.

 

## Need any help?

 

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.

  [Get in touch](<https://delaparra-services.nl/availability>)

[HTML version](https://delaparra-services.nl/knowledge-hub/build)
