mirror of
https://github.com/telekom-security/tpotce.git
synced 2025-07-01 04:22:11 +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
|
# Include dist
|
||||||
COPY dist/ /root/dist/
|
COPY dist/ /root/dist/
|
||||||
|
@ -11,7 +11,6 @@ RUN apk -U --no-cache add \
|
||||||
g++ \
|
g++ \
|
||||||
iptables-dev \
|
iptables-dev \
|
||||||
libnetfilter_queue-dev \
|
libnetfilter_queue-dev \
|
||||||
libcap \
|
|
||||||
libpcap-dev && \
|
libpcap-dev && \
|
||||||
#
|
#
|
||||||
# Setup go, glutton
|
# Setup go, glutton
|
||||||
|
@ -25,11 +24,19 @@ RUN apk -U --no-cache add \
|
||||||
mv /root/dist/system.go /opt/go/glutton/ && \
|
mv /root/dist/system.go /opt/go/glutton/ && \
|
||||||
go mod download && \
|
go mod download && \
|
||||||
make build && \
|
make build && \
|
||||||
cd / && \
|
mv /root/dist/rules.yaml /opt/go/glutton/rules/
|
||||||
mkdir -p /opt/glutton && \
|
#
|
||||||
mv /opt/go/glutton/bin /opt/glutton/ && \
|
FROM alpine:3.16
|
||||||
mv /opt/go/glutton/config /opt/glutton/ && \
|
#
|
||||||
mv /opt/go/glutton/rules /opt/glutton/ && \
|
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 && \
|
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 /opt/glutton/bin/server && \
|
||||||
setcap cap_net_admin,cap_net_raw=+ep /sbin/xtables-legacy-multi && \
|
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 && \
|
addgroup -g 2000 glutton && \
|
||||||
adduser -S -s /bin/ash -u 2000 -D -g 2000 glutton && \
|
adduser -S -s /bin/ash -u 2000 -D -g 2000 glutton && \
|
||||||
mkdir -p /var/log/glutton && \
|
mkdir -p /var/log/glutton && \
|
||||||
mv /root/dist/rules.yaml /opt/glutton/rules/ && \
|
|
||||||
#
|
#
|
||||||
# Clean up
|
# Clean up
|
||||||
apk del --purge build-base \
|
|
||||||
git \
|
|
||||||
go \
|
|
||||||
g++ && \
|
|
||||||
rm -rf /var/cache/apk/* \
|
rm -rf /var/cache/apk/* \
|
||||||
/opt/go \
|
|
||||||
/root/*
|
/root/*
|
||||||
#
|
#
|
||||||
# Start glutton
|
# Start glutton
|
||||||
|
|
Loading…
Reference in a new issue