buildah
buildah copied to clipboard
Add support for buildah run with chroot isolation
What type of PR is this?
/kind feature
What this PR does / why we need it:
This adds support for running containers with chroot isolation. Internally, I actually use a jail instead of a real chroot since this is the only equivalent of the Linux UTS namespace. Large parts of the code are shared with Linux and I moved the shared functions to run_common.go in a similar way to the main run code.
[NO NEW TESTS NEEDED]
How to verify it
On a FreeBSD system, run:
c=$(sudo buildah from quay.io/dougrabson/freebsd-minimal:13.1)
sudo buildah run --isolation=chroot $c freebsd-version
sudo buildah rm $c
Which issue(s) this PR fixes:
None
Special notes for your reviewer:
Does this PR introduce a user-facing change?
None
@dfr cross-build is breaking because of https://github.com/containers/buildah/pull/4175, maybe you wanna wait and rebase after https://github.com/containers/buildah/pull/4175
@dfr
cross-buildis breaking because of #4175, maybe you wanna wait and rebase after #4175
Makes sense, thanks for the pointer. There were a couple of other cross build breaks related to "freebsd && !cgo" which I fixed.
The lint fail is due to my attempt to work around the fact that FreeBSD's struct rlimit contains signed members. I tried to hide this with a type alias but now lint complains on Linux about casting uint64 to uint64. Not sure how to address that yet :(.
/hold till v1.27.0
Rebased
@flouthoc @nalind @giuseppe @vrothberg @umohnani8 @ashley-cui PTAL
LGTM
LGTM @flouthoc @nalind @vrothberg @giuseppe PTAL
Rebased
Rebased
Rebased. I'm hoping this can be merged sometime soonish. I know its not particularly important given the existing support for isolation=oci but an ancestor of this code was used very early on to run simple container tests before I had an OCI runtime. This helped convince me that porting the containers stack to FreeBSD was viable and without that, I probably wouldn't be hassling you all today with podman PRs so it has some sentimental value :).
/lgtm /hold cancel
Rebased
LGTM
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: dfr, flouthoc, rhatdan
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [flouthoc,rhatdan]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment