forked from Jamesits/SND
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
29 lines (22 loc) · 882 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# build stage
FROM golang:1.20-bullseye as builder
ARG GOPATH=/tmp/go
RUN apt-get update -y \
&& apt-get install -y upx libcap2-bin \
&& go install github.com/goreleaser/goreleaser@latest
WORKDIR /root/snd
COPY . /root/snd/
RUN goreleaser build --config contrib/goreleaser/goreleaser.yaml --single-target --id "snd" --output "dist/snd" --snapshot --clean
# production stage
FROM debian:bullseye-slim
LABEL org.opencontainers.image.authors="[email protected]"
# Import the user and group files from the builder.
COPY --from=builder /etc/passwd /etc/group /etc/
COPY --from=builder /root/snd/dist/snd /usr/local/bin/
COPY --from=builder /root/snd/contrib/config/config.toml /etc/snd/
# nope
# See: https://github.com/moby/moby/issues/8460
# USER nobody:nogroup
EXPOSE 53/tcp 53/udp
ENTRYPOINT [ "/usr/local/bin/snd" ]
CMD [ "-config", "/etc/snd/config.toml" ]