Like Blake Mitchell sais, you cannot use ARG
in ENTRYPOINT
. However you can use your ARG
as a value for ENV
, that way you can use it with ENTRYPOINT
:
Dockerfile
ARG my_arg
ENV my_env_var=$my_arg
ENTRYPOINT echo $my_env_var
and run:
docker build --build-arg "my_arg=foo" ...
More Related Contents:
- How to pass arguments to a Dockerfile?
- 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
- Communication between multiple docker-compose projects
- Using Docker-Compose, how to execute multiple commands
- Docker not found when building docker image using Docker Jenkins container pipeline
- Multiple FROMs – what it means
- Docker : Can a container A call an executable located on an other container B?
- How to push a docker image to a private repository
- denied: requested access to the resource is denied: docker
- standard_init_linux.go:190: exec user process caused “no such file or directory” – Docker
- How do I mount a host directory as a volume in docker compose
- COPY with docker but with exclusion
- ARG or ENV, which one to use in this case?
- Re-using environment variables in docker-compose.yml
- How to use the host network, and any other user-defined network together in Docker-Compose?
- Connect to Kafka on host from Docker (ksqlDB)
- Multiple commands on docker ENTRYPOINT
- How to move Docker containers between different hosts?
- How to restart a single container with docker-compose
- How do I download Docker images without using the pull command?
- docker-compose: difference between networks and links
- How to directly mount NFS share/volume in container using docker compose v3
- Connect to another container using Docker compose
- How to define build-args in docker-compose?
- How to stop all containers when one container stops with docker-compose?