discord-tweeter/Dockerfile

21 lines
567 B
Text
Raw Normal View History

2023-08-29 18:00:00 +02:00
FROM golang:1.21 AS build
RUN apt-get update && \
apt-get install -y --no-install-recommends ca-certificates
WORKDIR /tmp/app
COPY . .
RUN go mod download && \
CGO_ENABLED=1 go build -a -buildmode=pie -trimpath -ldflags "-s -w -linkmode 'external' -extldflags '-static-pie' -X main.prefix=" -o discord-tweeter
FROM scratch
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
WORKDIR /app
COPY --from=build /tmp/app/discord-tweeter .
#COPY ./config.example.toml ./config.toml
ENTRYPOINT [ "./discord-tweeter" ]
# CMD [ "./config.toml" ]