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

  

Category: Docker 

# ARG

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

## What is ARG?

 

ARG: A build-time variable, passed with --build-arg. Available only during the build, not in the running container. ` ARG ` defines a variable that exists only while a Docker image is being built. You pass a value with ` docker build --build-arg VERSION=1.4 `, and steps in the Dockerfile can use it. It is handy for choosing a base image version, a package version or a build mode without editing the Dockerfile. Each value becomes part of the image's build history.

 

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 ARG

  

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

 

That is also why ` ARG ` is the wrong place for secrets. Values can be read later with ` docker history `, so a password or API token passed this way ends up readable by anyone who has the image. Use Docker's build secrets (` RUN --mount=type=secret `) instead. And remember that ` ARG ` values are gone at runtime. For settings the running container needs, use ` ENV ` or, better, environment variables set when the container starts.

    

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

 

```
ARG VERSION=1.0 RUN echo "building $VERSION"
```

 

## At a glance

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

 

## More Docker terms

 

- [ADD](<https://delaparra-services.nl/knowledge-hub/add>) 
- [anonymous volume](<https://delaparra-services.nl/knowledge-hub/anonymous-volume>) 
- [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>) 
- [build](<https://delaparra-services.nl/knowledge-hub/build>)

 

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

 

## 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/arg/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/arg)
