Last active
March 14, 2023 23:46
-
-
Save kwilczynski/4e2d3c0a960cf2ac52c078b31194442b to your computer and use it in GitHub Desktop.
Dockerfile for Piknik - https://github.com/jedisct1/piknik
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ARG go_version=1.17 | |
ARG alpine_version=latest | |
FROM golang:${go_version}-alpine AS builder | |
ARG GOOS=linux | |
ARG GOARCH=amd64 | |
ENV GOOS=${GOOS} | |
ENV GOARCH=${GOARCH} | |
ENV GOPATH "" | |
ENV GO111MODULE on | |
ENV CGO_ENABLED 0 | |
ENV GOGC off | |
RUN set -eux && \ | |
mkdir -p /build | |
WORKDIR /build | |
COPY . ./ | |
RUN set -eux && \ | |
apk --no-cache --update add ca-certificates | |
RUN set -eux && \ | |
echo "GOOS=${GOOS} GOARCH=${GOARCH}" && \ | |
go get -d -v && \ | |
go build \ | |
-ldflags '-extldflags "-static" -w -s' \ | |
-installsuffix 'static' \ | |
-a -o piknik . | |
RUN set -eux && \ | |
chmod 755 piknik | |
FROM scratch | |
ARG version=development | |
LABEL \ | |
org.label-schema.schema-version="1.0" \ | |
org.label-schema.name="piknik" \ | |
org.label-schema.version="${version}" \ | |
org.label-schema.description="Copy/paste anything over the network!" \ | |
org.label-schema.license="ISC" \ | |
org.label-schema.url="https://github.com/jedisct1/piknik" \ | |
org.label-schema.vcs-url="https://github.com/jedisct1/piknik.git" \ | |
org.label-schema.vcs-type="Git" \ | |
org.label-schema.vendor="Frank Denis" \ | |
version="${version}" \ | |
maintainer="Krzysztof Wilczyński <kw@linux.com>" \ | |
license="Apache-2.0" \ | |
vendor="Open Source Software" | |
ENV DEBUG false | |
COPY --from=builder \ | |
/etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | |
COPY --from=builder \ | |
/build/piknik /piknik | |
EXPOSE 8075 | |
STOPSIGNAL SIGTERM | |
ENTRYPOINT [ "/piknik" ] | |
CMD [ "-server", "-config", "piknik.toml" ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment