Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 18 additions & 21 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,33 @@ RUN zypper ar -p 90 -r https://download.opensuse.org/repositories/devel:/languag
&& zypper --gpg-auto-import-keys ref \
&& zypper --non-interactive dup --allow-vendor-change
RUN zypper --non-interactive install -t pattern \
devel_C_C++ \
devel_basis \
devel_C_C++ \
devel_basis \
&& zypper --non-interactive install \
clang \
curl \
libelf-devel \
libopenssl-devel \
llvm \
rustup \
sudo \
tar \
xz \
zlib-devel \
clang \
curl \
libelf-devel \
libopenssl-devel \
llvm \
rustup \
sudo \
tar \
xz \
zlib-devel \
&& zypper clean
RUN rustup-init -y
ENV PATH="/root/.cargo/bin:${PATH}"
# Pin to Rust 1.56.1.
RUN rustup install 1.56.1 \
&& rustup default 1.56.1-x86_64-unknown-linux-gnu
RUN rustup component add \
clippy \
rustfmt
clippy \
rustfmt
RUN cargo install \
libbpf-cargo
libbpf-cargo

FROM builder AS build
WORKDIR /usr/local/src
# Build bpftool from the newest stable kernel sources.
RUN curl -Lso linux.tar.xz \
$(curl -s https://www.kernel.org/ | grep -A1 "latest_link" | grep -Eo '(http|https)://[^"]+') \
$(curl -s https://www.kernel.org/ | grep -A1 "latest_link" | grep -Eo '(http|https)://[^"]+') \
&& tar -xf linux.tar.xz \
&& mv $(find . -maxdepth 1 -type d -name "linux*") linux \
&& cd linux \
Expand All @@ -47,8 +44,8 @@ RUN cargo build --release
FROM registry.opensuse.org/opensuse/leap:15.3 AS lockcd
# runc links those libraries dynamically
RUN zypper --non-interactive install \
libseccomp2 \
libselinux1 \
libseccomp2 \
libselinux1 \
&& zypper clean
COPY --from=build /usr/local/src/linux/tools/bpf/bpftool/bpftool /usr/sbin/bpftool
COPY --from=build /usr/local/src/lockc/target/release/lockcd /usr/bin/lockcd
Expand Down
9 changes: 0 additions & 9 deletions lockc/src/runc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,7 @@ enum ContainerType {
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
struct Mount {
destination: String,
r#type: String,
source: String,
options: Vec<String>,
}

#[derive(Debug, Deserialize)]
Expand Down Expand Up @@ -224,12 +221,6 @@ fn policy_kubernetes_sync(
}
}

#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
struct Mounts {
mounts: Vec<Mount>,
}

fn policy_docker<P: AsRef<Path>>(
docker_bundle: P,
) -> Result<container_policy_level, ContainerError> {
Expand Down