bump glutton, tune down noisy log

This commit is contained in:
t3chn0m4g3
2019-10-15 14:50:39 +00:00
parent b9fb3d4695
commit 42c19e4d81
4 changed files with 95 additions and 25 deletions

View File

@ -1,8 +1,8 @@
FROM alpine
#
# Include dist
ADD dist/ /root/dist/
#
# Setup apk
RUN apk -U --no-cache add \
build-base \
@ -13,32 +13,32 @@ RUN apk -U --no-cache add \
libnetfilter_queue-dev \
libcap \
libpcap-dev && \
#
# Setup go, glutton
export GOPATH=/opt/go/ && \
go get -d github.com/mushorg/glutton && \
cd /opt/go/src/github.com/satori/ && \
rm -rf go.uuid && \
git clone https://github.com/satori/go.uuid && \
cd go.uuid && \
git checkout v1.2.0 && \
mv /root/dist/system.go /opt/go/src/github.com/mushorg/glutton/ && \
cd /opt/go/src/github.com/mushorg/glutton/ && \
export GO111MODULE=on && \
mkdir -p /opt/go && \
cd /opt/go/ && \
git clone https://github.com/mushorg/glutton && \
cd /opt/go/glutton/ && \
mv /root/dist/system.go /opt/go/glutton/ && \
go mod download && \
make build && \
cd / && \
mkdir -p /opt/glutton && \
mv /opt/go/src/github.com/mushorg/glutton/bin /opt/glutton/ && \
mv /opt/go/src/github.com/mushorg/glutton/config /opt/glutton/ && \
mv /opt/go/src/github.com/mushorg/glutton/rules /opt/glutton/ && \
mv /opt/go/glutton/bin /opt/glutton/ && \
mv /opt/go/glutton/config /opt/glutton/ && \
mv /opt/go/glutton/rules /opt/glutton/ && \
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-multi && \
setcap cap_net_admin,cap_net_raw=+ep /sbin/xtables-legacy-multi && \
#
# Setup user, groups and configs
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 \
@ -47,8 +47,8 @@ RUN apk -U --no-cache add \
rm -rf /var/cache/apk/* \
/opt/go \
/root/dist
#
# Start glutton
WORKDIR /opt/glutton
USER glutton:glutton
CMD exec bin/server -i $(/sbin/ip address | grep '^2: ' | awk '{ print $2 }' | tr -d [:punct:]) -l /var/log/glutton/glutton.log
CMD exec bin/server -i $(/sbin/ip address | grep '^2: ' | awk '{ print $2 }' | tr -d [:punct:]) -l /var/log/glutton/glutton.log > /dev/null 2>&1