For general information on using and setting up environment variables with Gitpod, see the Environment Variables documentation.
Setting Environment Variables in repository settings

Environment Variables in Repository Settings

Add an Environment Variable in Repository Settings
Setting Environment Variables in .gitpod.yml
.gitpod.yml
You can use this method when you need to refer to other variables or want to use scripting to set them conditionally.
.gitpod.yml
for more details.
Setting Environment Variables in Your Source Code
Alternatively, you can use theenv
property in your .gitpod.yml
file to set non-secret, static environment variables. Learn more.
Repository variables defined in the repository settings will take precedence and will override variables defined in the .gitpod.yml
’s env
property. See the Environment Variable Prioritization Stack for more.
Docker Registry Authentication
Gitpod supports the special environment variableGITPOD_IMAGE_AUTH
to configure access to private Docker registries (cmp. section “Use a private Docker image”).
By default, the environment variable GITPOD_IMAGE_AUTH
is not mounted into workspaces for security reasons. If this is wanted nonetheless (e.g. to enable developers to seamlessly use docker pull
/ docker push
, or to enable the gp validate
workflow), the repository configuration has a toggle to enable that.
When it’s enabled, and GITPOD_IMAGE_AUTH
is set - either on the repository or organization level -, dockerd
will be configured with these credentials on workspace start. Also, GITPOD_IMAGE_AUTH
is visible inside the workspace.