Skip to content

Commit

Permalink
Merge pull request #9231 from vrothberg/rootfs-workdir
Browse files Browse the repository at this point in the history
fix logic when not creating a workdir
  • Loading branch information
openshift-merge-robot authored Feb 5, 2021
2 parents 42d4652 + 821ef64 commit c421127
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions libpod/container_internal_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ func (c *Container) resolveWorkDir() error {
// we need to return the full error.
return errors.Wrapf(err, "error detecting workdir %q on container %s", workdir, c.ID())
}
return nil
}

// Ensure container entrypoint is created (if required).
Expand Down
13 changes: 13 additions & 0 deletions test/system/030-run.bats
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,19 @@ json-file | f
# a subdir of a volume.
run_podman run --rm --workdir /IamNotOntheImage -v $testdir/content:/IamNotOntheImage/foo $IMAGE cat foo
is "$output" "$randomcontent" "cat random content"

# Make sure that running on a read-only rootfs works (#9230).
if ! is_rootless && ! is_remote; then
# image mount is hard to test as a rootless user
# and does not work remotely
run_podman image mount $IMAGE
romount="$output"

run_podman run --rm --rootfs $romount echo "Hello world"
is "$output" "Hello world"

run_podman image unmount $IMAGE
fi
}

# https://github.com/containers/podman/issues/9096
Expand Down

0 comments on commit c421127

Please sign in to comment.