Update Glutton Dockerfile

This commit is contained in:
Lukas Rist 2024-05-07 14:26:18 +02:00 committed by GitHub
parent 5815664417
commit 1078ce537d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -5,21 +5,19 @@ COPY dist/ /root/dist/
# #
# Setup apk # Setup apk
RUN apk -U --no-cache add \ RUN apk -U --no-cache add \
build-base \ make \
git \ git \
g++ \ g++ \
iptables-dev \ iptables-dev \
libpcap-dev && \ libpcap-dev && \
# #
# Setup go, glutton # Setup go, glutton
export GO111MODULE=on && \
mkdir -p /opt/ && \ mkdir -p /opt/ && \
cd /opt/ && \ cd /opt/ && \
git clone https://github.com/mushorg/glutton && \ git clone https://github.com/mushorg/glutton && \
cd /opt/glutton/ && \ cd /opt/glutton/ && \
git checkout c1204c65ce32bfdc0e08fb2a9abe89b3b8eeed62 && \ git checkout c1204c65ce32bfdc0e08fb2a9abe89b3b8eeed62 && \
cp /root/dist/system.go . && \ cp /root/dist/system.go . && \
go mod download && \
make build && \ make build && \
mv /root/dist/config.yaml /opt/glutton/config/ mv /root/dist/config.yaml /opt/glutton/config/
# #
@ -30,11 +28,8 @@ COPY --from=builder /opt/glutton/config /opt/glutton/config
COPY --from=builder /opt/glutton/rules /opt/glutton/rules COPY --from=builder /opt/glutton/rules /opt/glutton/rules
# #
RUN apk -U --no-cache add \ RUN apk -U --no-cache add \
iptables \
iptables-dev \ iptables-dev \
libnetfilter_queue-dev \ libpcap-dev && \
libcap \
libpcap-dev && \
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-nft-multi && \ setcap cap_net_admin,cap_net_raw=+ep /sbin/xtables-nft-multi && \
mkdir -p /var/log/glutton \ mkdir -p /var/log/glutton \