aptible config:set
, are not available to commands executed during the Docker build.
It’s a good idea to follow Docker best practice and avoid depending on Configuration variables in instructions in your Dockerfile, but if you absolutely need to, Aptible provides a workaround: .aptible.env
.
.aptible.env
.aptible.env
file at the root of your repository prior to running the Docker build. The file contains your Configuration variables, and can be sourced by a shell.
Here’s an example:
❗️ Do not use the.aptible.env
file outside of Dockerfile instructions. This file is only injected when your image is built, so changes to your configuration will not be reflected in the.aptible.env
file unless you deploy again or rebuild. Outside of your Dockerfile, your configuration variables are accessible in the Container Environment.