In kubernetes iamges are used directly w/o docker compose. Hence, building is to rely on Dockerfile and build context exclusively.
This affects two aspects:
--build-arg switches for each variable. If not values are supplied, value from shell environment that runs docker-build is takenDockerfile must be set explicitly on the command line via -f flag.In total:
export ARG1=SOME_VALUE
export ARG2=OTHER_VALUE
#take . as the context
docker build --build-arg ARG1 --build-arg ARG2 -f /path/to/dockerfile .