2021-01-27 20:13:02 +00:00
|
|
|
FROM golang:alpine as builder
|
2017-12-29 22:48:36 +00:00
|
|
|
|
2024-03-18 17:26:14 +00:00
|
|
|
COPY . /src/share
|
|
|
|
WORKDIR /src/share
|
2017-12-29 22:48:36 +00:00
|
|
|
|
|
|
|
RUN set -ex \
|
2021-01-27 20:13:02 +00:00
|
|
|
&& apk add --update git \
|
|
|
|
&& go install \
|
|
|
|
-ldflags "-X main.version=$(git describe --tags --always || echo dev)" \
|
2024-03-18 17:26:14 +00:00
|
|
|
-mod=readonly \
|
|
|
|
-modcacherw \
|
|
|
|
-trimpath
|
|
|
|
|
2021-01-27 20:13:02 +00:00
|
|
|
|
|
|
|
FROM alpine:latest
|
|
|
|
|
|
|
|
LABEL maintainer "Knut Ahlers <knut@ahlers.me>"
|
|
|
|
|
|
|
|
RUN set -ex \
|
|
|
|
&& apk --no-cache add \
|
|
|
|
ca-certificates
|
|
|
|
|
|
|
|
COPY --from=builder /go/bin/share /usr/local/bin/share
|
2017-12-29 22:48:36 +00:00
|
|
|
|
|
|
|
EXPOSE 3000
|
|
|
|
|
2021-01-27 20:13:02 +00:00
|
|
|
ENTRYPOINT ["/usr/local/bin/share"]
|
2017-12-29 22:48:36 +00:00
|
|
|
CMD ["--"]
|
2021-01-27 20:13:02 +00:00
|
|
|
|
|
|
|
# vim: set ft=Dockerfile:
|