Skip to content

Commit c1b4a9e

Browse files
authored
Keep readonly-volume-mounted config.json (#119)
1 parent 8962d96 commit c1b4a9e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

envbuilder.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -772,9 +772,11 @@ func Run(ctx context.Context, options Options) error {
772772
unsetOptionsEnv()
773773

774774
// Remove the Docker config secret file!
775-
err = os.Remove(filepath.Join(os.Getenv("DOCKER_CONFIG"), "config.json"))
776-
if err != nil && !os.IsNotExist(err) {
777-
return fmt.Errorf("remove docker config: %w", err)
775+
if options.DockerConfigBase64 != "" {
776+
err = os.Remove(filepath.Join(MagicDir, "config.json"))
777+
if err != nil && !os.IsNotExist(err) {
778+
return fmt.Errorf("remove docker config: %w", err)
779+
}
778780
}
779781

780782
environ, err := os.ReadFile("/etc/environment")

0 commit comments

Comments
 (0)