mirror of
https://github.com/telekom-security/tpotce.git
synced 2025-07-01 12:32:12 +00:00
Bump Glutton to Alpine 3.16, decrease image size
This commit is contained in:
parent
09c682cd7b
commit
8993f59001
1 changed files with 14 additions and 13 deletions
|
@ -1,4 +1,4 @@
|
|||
FROM alpine:3.15
|
||||
FROM alpine:3.15 as builder
|
||||
#
|
||||
# Include dist
|
||||
COPY dist/ /root/dist/
|
||||
|
@ -11,7 +11,6 @@ RUN apk -U --no-cache add \
|
|||
g++ \
|
||||
iptables-dev \
|
||||
libnetfilter_queue-dev \
|
||||
libcap \
|
||||
libpcap-dev && \
|
||||
#
|
||||
# Setup go, glutton
|
||||
|
@ -25,11 +24,19 @@ RUN apk -U --no-cache add \
|
|||
mv /root/dist/system.go /opt/go/glutton/ && \
|
||||
go mod download && \
|
||||
make build && \
|
||||
cd / && \
|
||||
mkdir -p /opt/glutton && \
|
||||
mv /opt/go/glutton/bin /opt/glutton/ && \
|
||||
mv /opt/go/glutton/config /opt/glutton/ && \
|
||||
mv /opt/go/glutton/rules /opt/glutton/ && \
|
||||
mv /root/dist/rules.yaml /opt/go/glutton/rules/
|
||||
#
|
||||
FROM alpine:3.16
|
||||
#
|
||||
COPY --from=builder /opt/go/glutton/bin /opt/glutton/bin
|
||||
COPY --from=builder /opt/go/glutton/config /opt/glutton/config
|
||||
COPY --from=builder /opt/go/glutton/rules /opt/glutton/rules
|
||||
#
|
||||
RUN apk -U --no-cache add \
|
||||
iptables-dev \
|
||||
libnetfilter_queue-dev \
|
||||
libcap \
|
||||
libpcap-dev && \
|
||||
ln -s /sbin/xtables-legacy-multi /sbin/xtables-multi && \
|
||||
setcap cap_net_admin,cap_net_raw=+ep /opt/glutton/bin/server && \
|
||||
setcap cap_net_admin,cap_net_raw=+ep /sbin/xtables-legacy-multi && \
|
||||
|
@ -38,15 +45,9 @@ RUN apk -U --no-cache add \
|
|||
addgroup -g 2000 glutton && \
|
||||
adduser -S -s /bin/ash -u 2000 -D -g 2000 glutton && \
|
||||
mkdir -p /var/log/glutton && \
|
||||
mv /root/dist/rules.yaml /opt/glutton/rules/ && \
|
||||
#
|
||||
# Clean up
|
||||
apk del --purge build-base \
|
||||
git \
|
||||
go \
|
||||
g++ && \
|
||||
rm -rf /var/cache/apk/* \
|
||||
/opt/go \
|
||||
/root/*
|
||||
#
|
||||
# Start glutton
|
||||
|
|
Loading…
Reference in a new issue