forked from kubearmor/KubeArmor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.init
28 lines (20 loc) · 923 Bytes
/
Dockerfile.init
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# SPDX-License-Identifier: Apache-2.0
# Copyright 2021 Authors of KubeArmor
### build syscall checker
FROM golang:1.18-alpine3.15 as init-builder
WORKDIR /usr/src/KubeArmor
COPY ./KubeArmor/BPF/tests/main.go main.go
COPY ./KubeArmor/BPF/tests/go.mod go.mod
COPY ./KubeArmor/BPF/tests/go.sum go.sum
RUN go build -o syscheck main.go
### Make compiler image
FROM alpine:3.15 as kubearmor-init
RUN apk --no-cache update
RUN echo "@edge http://dl-cdn.alpinelinux.org/alpine/edge/main" | tee -a /etc/apk/repositories
RUN echo "@edge http://dl-cdn.alpinelinux.org/alpine/edge/community" | tee -a /etc/apk/repositories
RUN apk --no-cache update
RUN apk --no-cache add bash git clang llvm make gcc bpftool@edge
COPY ./KubeArmor/BPF /KubeArmor/BPF/
COPY ./KubeArmor/build/compile.sh /KubeArmor/compile.sh
COPY --from=init-builder /usr/src/KubeArmor/syscheck /KubeArmor/BPF/tests/syscheck
ENTRYPOINT ["/KubeArmor/compile.sh"]