-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PR 189 (6e07a44) was immaturely merged and never worked with file write operations and DNS operations. This commit includes the following fixes: - Change the type of the `snapshots` directory from `container_ro_file_t` to `container_file_t`, as it is used as an upperdir as well as a lowerdir. OCI (runc) worker mode: lowerdir=/var/lib/buildkit/runc-overlayfs/snapshots/snapshots/3/fs upperdir=/var/lib/buildkit/runc-overlayfs/snapshots/snapshots/4/fs workdir=/var/lib/buildkit/runc-overlayfs/snapshots/snapshots/4/work containerd worker mode: lowerdir=/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/3/fs upperdir=/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/4/fs workdir=/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/4/work - Add `files_var_lib_filetrans($1, container_var_lib_t, dir, "containerd")` to initialize `/var/lib/containerd` for containerd mode. - Add `filetrans_pattern($1, container_var_lib_t, container_ro_file_t, dir, "executor")` for `/var/lib/buildkit/runc-<SNAPSHOTTER>/executor`. This directory contains `resolv.conf` and `hosts.<RANDOM>` for OCI (runc) worker mode. - Add `filetrans_pattern($1, container_var_lib_t, container_ro_file_t, dir, "containerd-overlayfs")` for `/var/lib/buildkit/containerd-<SNAPSHOTTER>`. This directory contains `resolv.conf` and `hosts.<RANDOM>` for containerd worker mode. Unlike the `runc-<SNAPSHOTTER>` directory, this directory does not contain the "executor" directory inside it. This commit is tested with both OCI (runc) worker mode and containerd worker mode, using a simple Dockerfile like `RUN apk add neofetch` on Fedora 36, BuildKit v0.10.5, runc v1.1.4, and containerd v1.6.8. Fix issue 190 . Note that this still does not work with `RUN --mount=type=secret`, as the container processes with the `container_t` type can't access the tmpfs mounts with the `container_runtime_tmpfs_t` on `/tmp/buildkit-secrets<RANDOM>`. Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
- Loading branch information
1 parent
a7a1013
commit 8ca4b89
Showing
3 changed files
with
42 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters