@@ -25,6 +25,7 @@ import (
2525
2626 wsk8s "github.com/gitpod-io/gitpod/common-go/kubernetes"
2727 "github.com/gitpod-io/gitpod/common-go/tracing"
28+ "github.com/gitpod-io/gitpod/common-go/util"
2829 csapi "github.com/gitpod-io/gitpod/content-service/api"
2930 regapi "github.com/gitpod-io/gitpod/registry-facade/api"
3031 "github.com/gitpod-io/gitpod/ws-manager-mk2/pkg/constants"
@@ -574,6 +575,23 @@ func createWorkspaceEnvironment(sctx *startWorkspaceContext) ([]corev1.EnvVar, e
574575 result = append (result , corev1.EnvVar {Name : "GIT_SSL_CAINFO" , Value : customCAMountPath })
575576 }
576577
578+ if sctx .Workspace .Annotations [wsk8s .WorkspaceDockerdProxyAnnotation ] == util .BooleanTrueString {
579+ var imageAuth string
580+ for _ , ev := range sctx .Workspace .Spec .UserEnvVars {
581+ if ev .Name == "GITPOD_IMAGE_AUTH" {
582+ imageAuth = ev .Value
583+ break
584+ }
585+ }
586+ if imageAuth != "" {
587+ // Start the dockerd-proxy which injects all HTTP(S) requests with the credentials we got in GITPOD_IMAGE_AUTH
588+ result = append (result , corev1.EnvVar {Name : "WORKSPACEKIT_RING2_ENCLAVE" , Value : "/.supervisor/supervisor dockerd-proxy" })
589+ result = append (result , corev1.EnvVar {Name : "WORKSPACEKIT_GITPOD_IMAGE_AUTH" , Value : string (imageAuth )})
590+ // Trigger supervisor to configure dockerd to use this proxy
591+ result = append (result , corev1.EnvVar {Name : "GITPOD_DOCKERD_PROXY_ENABLED" , Value : "true" })
592+ }
593+ }
594+
577595 // System level env vars
578596 for _ , e := range sctx .Workspace .Spec .SysEnvVars {
579597 env := corev1.EnvVar {
0 commit comments