Type Alias DockerEnvMap<RequiredKeys>

DockerEnvMap<RequiredKeys>: Readonly<Record<RequiredKeys | string, {
    allowInterpolation: boolean;
    value: string;
}>>

A set of environment mappings for a docker container.

  • Each key in this object represents the env var name within the Docker container.
  • Each value property can be either the value that the env var should be set to or an existing env var's interpolation into the value.
  • If the value string is meant to be interpolated within the shell context, make sure to set allowInterpolation to true. Otherwise, it's best to leave it as false.

Type Parameters

  • RequiredKeys extends string = string
const envMapping: DockerEnvMap = {
VAR_1: {
value: 'hi',
// set to false because this is a raw string value that is not meant to be interpolated
allowInterpolation: false,
},
VAR_2: {
// the value here will be interpolated from the current shell's value for `EXISTING_VAR`
value: '$EXISTING_VAR',
// set to true to allow '$EXISTING_VAR' to be interpolated by the shell
allowInterpolation: true,
},
};