2018-09-09 21:22:58 +00:00
|
|
|
FROM golang:alpine as builder
|
|
|
|
|
2021-02-19 18:05:18 +00:00
|
|
|
COPY . /go/src/github.com/Luzifer/go-holidays
|
|
|
|
WORKDIR /go/src/github.com/Luzifer/go-holidays/cmd/holiday-api
|
2018-09-09 21:22:58 +00:00
|
|
|
|
|
|
|
RUN set -ex \
|
|
|
|
&& apk add --update git \
|
2021-02-19 18:05:18 +00:00
|
|
|
&& go install \
|
|
|
|
-ldflags "-X main.version=$(git describe --tags --always || echo dev)" \
|
|
|
|
-mod=readonly
|
2018-09-09 21:22:58 +00:00
|
|
|
|
|
|
|
FROM alpine:latest
|
|
|
|
|
|
|
|
LABEL maintainer "Knut Ahlers <knut@ahlers.me>"
|
|
|
|
|
|
|
|
RUN set -ex \
|
2021-02-19 18:05:18 +00:00
|
|
|
&& apk --no-cache add \
|
|
|
|
ca-certificates
|
2018-09-09 21:22:58 +00:00
|
|
|
|
|
|
|
COPY --from=builder /go/bin/holiday-api /usr/local/bin/
|
|
|
|
|
|
|
|
EXPOSE 3000
|
|
|
|
|
|
|
|
ENTRYPOINT ["/usr/local/bin/holiday-api"]
|
|
|
|
CMD ["--"]
|
|
|
|
|
|
|
|
# vim: set ft=Dockerfile:
|