fix(docker): only check the DOCKER_CONFIG path when relevant

relates to #3549
This commit is contained in:
Jan De Dobbeleer 2023-03-12 13:59:10 +01:00 committed by Jan De Dobbeleer
parent 7b2e2ff5d2
commit 8d92c87e05

View file

@ -33,10 +33,16 @@ func (d *Docker) envVars() []string {
}
func (d *Docker) configFiles() []string {
return []string{
filepath.Join(d.env.Home(), "/.docker/config.json"),
filepath.Join(d.env.Getenv("DOCKER_CONFIG"), "/config.json"),
files := []string{
filepath.Join(d.env.Home(), ".docker/config.json"),
}
dockerConfig := d.env.Getenv("DOCKER_CONFIG")
if len(dockerConfig) > 0 {
files = append(files, filepath.Join(dockerConfig, "config.json"))
}
return files
}
func (d *Docker) Enabled() bool {