2024-11-14 17:12:55 +01:00
FROM golang:1.23-alpine AS builder
2024-09-04 21:45:00 +02:00
#
ENV GO111MODULE = on \
CGO_ENABLED = 0 \
GOOS = linux
#
2024-09-11 10:42:17 +00:00
# Install packages
RUN apk -U add git
2024-09-04 21:45:00 +02:00
#
WORKDIR /root
#
# Build beelzebub
2024-12-05 21:12:18 +01:00
RUN git clone https://github.com/t3chn0m4g3/beelzebub && \
cd beelzebub && \
git checkout 17a0854b8d9d1e41cf5435b5dc85354bbfb9093c
2024-09-04 21:45:00 +02:00
WORKDIR /root/beelzebub
RUN go mod download
RUN go build -o main .
2024-11-14 17:12:55 +01:00
RUN sed -i "s#logsPath: ./log#logsPath: ./configurations/log/beelzebub.json#g" /root/beelzebub/configurations/beelzebub.yaml
RUN sed -i 's/passwordRegex: "^(root|qwerty|Smoker666|123456|jenkins|minecraft|sinus|alex|postgres|Ly123456)$"/passwordRegex: ".*"/g' /root/beelzebub/configurations/services/ssh-22.yaml
2024-09-04 21:45:00 +02:00
#
2024-11-14 17:12:55 +01:00
FROM scratch
2024-09-04 21:45:00 +02:00
#
COPY --from= builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from= builder /root/beelzebub/main /opt/beelzebub/
COPY --from= builder /root/beelzebub/configurations /opt/beelzebub/configurations
#
# Start beelzebub
WORKDIR /opt/beelzebub
2024-11-14 17:12:55 +01:00
USER 2000:2000
ENTRYPOINT [ "./main" ]