Skip to content

Commit

Permalink
chrootarchive: propagate env from parent
Browse files Browse the repository at this point in the history
propagate the environment variables from the current process since
they are needed by pkg/unshare to read the UID for the user that
created the user namespace (through the _CONTAINERS_ROOTLESS_UID env
variable).

Signed-off-by: Giuseppe Scrivano <[email protected]>
  • Loading branch information
giuseppe committed Sep 8, 2022
1 parent 74ce86d commit 96ea882
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/chrootarchive/diff_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func applyLayerHandler(dest string, layer io.Reader, options *archive.TarOptions

cmd := reexec.Command("storage-applyLayer", dest)
cmd.Stdin = layer
cmd.Env = append(cmd.Env, fmt.Sprintf("OPT=%s", data))
cmd.Env = append(os.Environ(), fmt.Sprintf("OPT=%s", data))

outBuf, errBuf := new(bytes.Buffer), new(bytes.Buffer)
cmd.Stdout, cmd.Stderr = outBuf, errBuf
Expand Down

0 comments on commit 96ea882

Please sign in to comment.