Container Functions
- container_functions.bsh
Common functionality for adding extra just features to container services
- JUST_IN_CONTAINER
An environment variable that will be set inside of a container so that a script can know it is inside a container started by just. It is set to the specific container technology so that scripts can adapt to the specific container technology used. (E.g. docker, singularity, podman, etc…).
- container_environment_override
- Arguments:
$1- The name of a function that takes two arguments, variable name and variable value, and writes to the corresponding configuration file.JUST_PROJECT_PREFIX- The Just project prefix valueJUST_DISABLE_ENVIRONMENT_SWAP- Transparently swap environment variables as they are added to the docker environmentEXPORT_DOCKER- Also exports the${1}_.*_DOCKERversion of the variable when using the transparent environment variable swap feature (the swap effectively becomes a copy).
Sets up a number of environment variables to make containers behave the way we want them to
JUST_HOST_WINDOWS- Set to1on Windows, else unset. This is primarily used in the entrypoint to remove a second slash at the beginning of environment variables that have to be placed there due to limitations in MINGW/Cygwin. These double slashes have, on occasion, caused apps to fail, so removing them becomes important.${JUST_PROJECT_PREFIX}_DOCKER- variables are swapped
See also
docker_compose_override generate_docker_compose_overrideUses this for environment variables
- translate_path
Translates a path from one filesystem to another, useful for going from host to a container.
- Arguments:
$1- Original path$2, [$4, $6, ...]- Host paths$3, [$5, $7, ...]- Container paths
- Output:
stdout - The translated path. If none of the path pairs translated the path, the original path returned
- is_in_container
Tests to see if you are currently in a container. Currently only supports: - docker - singularity - podman
- Return Value:
0- In a container1- Not in a container