mirror of
https://github.com/Luzifer/share.git
synced 2024-12-20 10:31:16 +00:00
Improve Dockerfile
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
4a9444e6cd
commit
0f6c1695bc
1 changed files with 19 additions and 8 deletions
27
Dockerfile
27
Dockerfile
|
@ -1,16 +1,27 @@
|
||||||
FROM golang:alpine
|
FROM golang:alpine as builder
|
||||||
|
|
||||||
LABEL maintainer "Knut Ahlers <knut@ahlers.me>"
|
COPY . /go/src/github.com/Luzifer/share
|
||||||
|
|
||||||
ADD . /go/src/github.com/Luzifer/share
|
|
||||||
WORKDIR /go/src/github.com/Luzifer/share
|
WORKDIR /go/src/github.com/Luzifer/share
|
||||||
|
|
||||||
RUN set -ex \
|
RUN set -ex \
|
||||||
&& apk add --update git ca-certificates \
|
&& apk add --update git \
|
||||||
&& go install -ldflags "-X main.version=$(git describe --tags || git rev-parse --short HEAD || echo dev)" \
|
&& go install \
|
||||||
&& apk del --purge git
|
-ldflags "-X main.version=$(git describe --tags --always || echo dev)" \
|
||||||
|
-mod=readonly
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|
||||||
ENTRYPOINT ["/go/bin/share"]
|
ENTRYPOINT ["/usr/local/bin/share"]
|
||||||
CMD ["--"]
|
CMD ["--"]
|
||||||
|
|
||||||
|
# vim: set ft=Dockerfile:
|
||||||
|
|
Loading…
Reference in a new issue