diff --git a/Dockerfile b/Dockerfile index e08bed2..527c8bf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 \ @@ -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 diff --git a/lockc/src/runc.rs b/lockc/src/runc.rs index d2f5147..a931913 100644 --- a/lockc/src/runc.rs +++ b/lockc/src/runc.rs @@ -62,10 +62,7 @@ enum ContainerType { #[derive(Debug, Deserialize)] #[serde(rename_all = "camelCase")] struct Mount { - destination: String, - r#type: String, source: String, - options: Vec, } #[derive(Debug, Deserialize)] @@ -224,12 +221,6 @@ fn policy_kubernetes_sync( } } -#[derive(Debug, Deserialize)] -#[serde(rename_all = "camelCase")] -struct Mounts { - mounts: Vec, -} - fn policy_docker>( docker_bundle: P, ) -> Result {