v1

You can set build arguments (ARG) to be passed to the Docker container at build-time in jobs, build services, and combined services.

Your build arguments will be passed to the Dockerfile on build via the --build-arg flag. They do not persist in the built image and are set as key-value pairs.

Variables must be declared in the Dockerfile with ARG before being accessed.

For example, a variable set as "packages" : "npm-cache" can be accessed in the Dockerfile by declaring the ARG:

ARG packages
# or initialise with a default value:
# ARG packages=default_value

RUN echo "Using: ${packages}"

To set build arguments navigate to the build arguments page in your service and select an editor mode. You may be prompted to enter your password.

Learn more about ARG .

You can set environment variables (ENV) in to be passed to the Docker container at runtime. Secrets can be saved and used within a project in secret groups.

Your environment variables can be accessed via the process environment. They will not, however, be saved in the container filesystem.

Environment variables can be accessed in the Dockerfile by passing the value to the ENV variable as a build argument (ARG):

ENV env_value=${example_value}
 # set env_value to the value
 # of example_value

After this example_value and env_value all return the value Northflank when accessed in the process environment.

Example: in a Node environment a variable set as `"env_value" : "Northflank"` can be accessed within the container by referring to `process.env.env_value`.

To set environment variables navigate to the environment page in your service and select an editor mode. You may be prompted to enter your password.

Learn more about environment variables .

© 2021 Northflank Ltd. All rights reserved.