As of Docker 1.9, You are looking for --build-arg
and the ARG
instruction.
Check out this document for reference. This will allow you to add ARG arg
to the Dockerfile
and then build with
docker build --build-arg arg=2.3 .
More Related Contents:
- How to pass ARG value to ENTRYPOINT?
- How to pass arguments within docker-compose?
- Docker COPY from ubuntu absolute path
- Why the “none” image appears in Docker and how can we avoid it
- How to mount local volumes in docker machine
- An error, “failed to solve with frontend dockerfile.v0”
- Difference between links and depends_on in docker_compose.yml
- Docker Compose wait for container X before starting Y
- What is the difference between docker-compose ports vs expose
- How to mount a single file in a volume
- How to update /etc/hosts file in Docker image during “docker build”
- Docker Compose + Spring Boot + Postgres connection
- Conditional COPY/ADD in Dockerfile?
- How to specify Memory & CPU limit in docker compose version 3
- How to get a list of images on docker registry v2
- Externalising Spring Boot properties when deploying to Docker
- How can I use a variable inside a Dockerfile CMD?
- What is the difference between ports and expose in docker-compose?
- How to fill user input for interactive command for “RUN” command?
- How to use environment variables in docker-compose?
- How do I set hostname in docker-compose?
- How do I configure docker compose to expose ports correctly?
- Docker: Using –password via the CLI is insecure. Use –password-stdin
- Share variable in multi-stage Dockerfile: ARG before FROM not substituted
- Docker follow symlink outside context
- how do you manage secret values with docker-compose v3.1?
- Dockerfile: Output of RUN instruction into a Variable
- Substitute environment variables in NGINX config from docker-compose
- Build a single image based on docker compose containers
- What is the purpose of the file “docker.sock”?