multi stage build for dicompot
rebuild fatt, glutton, hellpot, honeypots for alpine 3.19
bump glutton, hellpot, honeypots to latest master
This commit is contained in:
t3chn0m4g3
2024-03-05 19:50:35 +01:00
parent 519a101fdf
commit c45870594b
66 changed files with 464 additions and 225 deletions

View File

@ -1,4 +1,4 @@
FROM alpine:3.19
FROM golang:1.21-alpine as builder
#
# Include dist
COPY dist/ /root/dist/
@ -8,7 +8,6 @@ RUN apk -U add --no-cache \
build-base \
git \
g++ && \
apk -U add --no-cache go --repository http://dl-3.alpinelinux.org/alpine/edge/community && \
#
# Setup go, build dicompot
mkdir -p /opt/go && \
@ -18,26 +17,20 @@ RUN apk -U add --no-cache \
cd dicompot && \
git checkout 41331194156bbb17078bcc1594f4952ac06a731e && \
go mod download && \
go install -a -x github.com/nsmfoo/dicompot/server && \
go install -a -x github.com/nsmfoo/dicompot/server
#
FROM alpine:3.19
#
# Setup dicompot
mkdir -p /opt/dicompot/images && \
cp /opt/go/bin/server /opt/dicompot && \
cp -R /root/dist/dcm_pts/P1/ /opt/dicompot/images && \
#
COPY --from=builder /opt/go/bin/server /opt/dicompot/server
COPY --from=builder /root/dist/dcm_pts/images /opt/dicompot/images
#
# Setup user, groups and configs
addgroup -g 2000 dicompot && \
adduser -S -s /bin/ash -u 2000 -D -g 2000 dicompot && \
chown -R dicompot:dicompot /opt/dicompot && \
#
# Clean up
apk del --purge build-base \
git \
go \
g++ && \
rm -rf /var/cache/apk/* \
/opt/go \
/root/dist
RUN addgroup -g 2000 dicompot && \
adduser -S -s /bin/ash -u 2000 -D -g 2000 dicompot && \
chown -R dicompot:dicompot /opt/dicompot
#
# Start dicompot
WORKDIR /opt/dicompot