KubeArmor/Dockerfile.init
Charan 3db63ddd5d
Update maintainers and annotations in sample policies (#2722)
Signed-off-by: charankamal20 <charanksingh20@gmail.com>
2026-07-02 11:36:17 +05:30

60 lines
2 KiB
Text

# SPDX-License-Identifier: Apache-2.0
# Copyright 2026 Authors of KubeArmor
FROM alpine:3.22 AS kubearmor-init
RUN apk --no-cache update
RUN apk --no-cache update && \
apk upgrade --no-cache libcrypto3 libssl3 zlib libexpat && \
apk add --no-cache musl musl-utils perl
RUN apk --no-cache update
RUN apk --no-cache add bash git clang llvm make gcc bpftool
COPY ./KubeArmor/BPF /KubeArmor/BPF/
COPY ./KubeArmor/build/compile.sh /KubeArmor/compile.sh
ENTRYPOINT ["/KubeArmor/compile.sh"]
### Make compiler image
FROM redhat/ubi10-minimal AS kubearmor-init-ubi
ARG VERSION=latest
LABEL name="kubearmor-init" \
vendor="KubeArmor" \
maintainer="Achref Ben Saad, Aryan Sharma, Aryan Bakliwal" \
version=${VERSION} \
release=${VERSION} \
summary="kubearmor-init container image based on redhat ubi" \
description="kubearmor-init image for kubearmor init container image"
RUN microdnf -y update && \
microdnf -y install --nodocs --setopt=install_weak_deps=0 --setopt=keepcache=0 \
glibc-devel && \
microdnf -y install --nodocs --setopt=install_weak_deps=0 --setopt=keepcache=0 \
shadow-utils git clang llvm make gcc libbpf tar gzip && \
microdnf clean all
# install bpftool
RUN arch=$(uname -m) bpftool_version=v7.2.0 && \
if [[ "$arch" == "aarch64" ]]; then \
arch=arm64; \
elif [[ "$arch" == "x86_64" ]]; then \
arch=amd64; \
fi && \
curl -LO https://github.com/libbpf/bpftool/releases/download/$bpftool_version/bpftool-$bpftool_version-$arch.tar.gz && \
tar -xzf bpftool-$bpftool_version-$arch.tar.gz -C /usr/local/bin && \
chmod +x /usr/local/bin/bpftool
RUN groupadd --gid 1000 default \
&& useradd --uid 1000 --gid default --shell /bin/bash --create-home default
COPY LICENSE /licenses/license.txt
COPY ./KubeArmor/BPF /KubeArmor/BPF/
COPY ./KubeArmor/build/compile.sh /KubeArmor/compile.sh
RUN chown -R default:default /KubeArmor
USER 1000
ENTRYPOINT ["/KubeArmor/compile.sh"]