Build Arguments
Use build arguments to modify the app or its behaviour during build time
You may specify build-time arguments in the auterion-app.yml file using the build-args
keyword:
services:
test-app:
ssh: true
build: .
build-args:
BAR: ${FOO}
The environment variable FOO
and the docker build argument BAR
can then be defined in the environment where auterion-cli is executed, for example:
# This will assign "123" to the BAR variable in the Dockerfile
FOO="123" auterion-cli app build
Alternatively the environment variable can be defined in a top-level .env
file in the app directory:
# This will also assign "123" to the BAR variable in the Dockerfile
FOO="123"
The BAR
docker build argument can then be used at build-time from your Dockerfile:
FROM auterion/app-base:v2
ARG BAR
RUN echo "My docker build arg is ${BAR}"
Last updated