Skip to content

Commit 3fbe453

Browse files
committed
starlark/module: experimental/docker DOCKER_CONFIG_FILE support
1 parent 2d1de14 commit 3fbe453

File tree

1 file changed

+9
-1
lines changed
  • starlark/module/experimental/docker

1 file changed

+9
-1
lines changed

starlark/module/experimental/docker/image.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"errors"
66
"fmt"
77
"os"
8+
"path/filepath"
89
"sort"
910
"sync"
1011

@@ -239,7 +240,14 @@ func versionToList(versions []*semver.Version, other []string) []string {
239240
}
240241

241242
func imageSystemContext() *types.SystemContext {
243+
cfgFile := os.Getenv("DOCKER_CONFIG_FILE")
244+
if cfgFile == "" {
245+
if cfgPath := os.Getenv("DOCKER_CONFIG"); cfgPath != "" {
246+
cfgFile = filepath.Join(cfgPath, "config.json")
247+
}
248+
}
249+
242250
return &types.SystemContext{
243-
AuthFilePath: os.Getenv("DOCKER_CONFIG"),
251+
AuthFilePath: cfgFile,
244252
}
245253
}

0 commit comments

Comments
 (0)