I want to send an argument USE_ALPINE to docker file if it is true i will use alpine image if it is false i will use debian image
the default value for USE_ALPINE i want to set it to false.
I want to send an argument USE_ALPINE to docker file if it is true i will use alpine image if it is false i will use debian image
the default value for USE_ALPINE i want to set it to false.
Make use of combination of ARG and FROM in Dockerfile.
You can use variables declared in ARG inside FROM statement.
ARG APP_IMAGE=alpine:latest
FROM ${APP_IMAGE}
CMD /path/to/mycode
And can also override this value using --build-arg option of docker build command.
docker build -t myapp:v1 --build-arg APP_IMAGE=busybox:latest .