Skip to content

Commit 0125ec1

Browse files
authored
Merge pull request #90 from germag/force-run-as-root
Overwrite the USER directive
2 parents e120659 + b818943 commit 0125ec1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/bootc/bootc_disk.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,8 @@ func (p *BootcDisk) createInstallContainer(config DiskImageConfig) *exec.Cmd {
304304
// Basic config:
305305
// - force on --remote because we depend on podman machine.
306306
// - add privileged, pid=host, SELinux config and bind mounts per https://containers.github.io/bootc/bootc-install.html
307-
podmanArgs := []string{"--remote", "run", "--rm", "-i", "--pid=host", "--privileged", "--security-opt=label=type:unconfined_t", "--volume=/dev:/dev", "--volume=/var/lib/containers:/var/lib/containers"}
307+
// - we need force running as root (i.e., --user=root:root) to overwrite any possible USER directive in the Containerfile
308+
podmanArgs := []string{"--remote", "run", "--rm", "-i", "--pid=host", "--user=root:root", "--privileged", "--security-opt=label=type:unconfined_t", "--volume=/dev:/dev", "--volume=/var/lib/containers:/var/lib/containers"}
308309
// Custom bind mounts
309310
podmanArgs = append(podmanArgs, fmt.Sprintf("--volume=%s:/output", p.Directory))
310311
if term.IsTerminal(int(os.Stdin.Fd())) {

0 commit comments

Comments
 (0)