mirror of
https://github.com/Luzifer/mercedes-byocar-exporter.git
synced 2024-12-20 09:51:20 +00:00
Add Dockerfile
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
17358701ab
commit
3982c9c381
1 changed files with 31 additions and 0 deletions
31
Dockerfile
Normal file
31
Dockerfile
Normal file
|
@ -0,0 +1,31 @@
|
|||
FROM golang:alpine as builder
|
||||
|
||||
COPY . /src/mercedes-byocar-exporter
|
||||
WORKDIR /src/mercedes-byocar-exporter
|
||||
|
||||
RUN set -ex \
|
||||
&& apk add --update \
|
||||
build-base \
|
||||
git \
|
||||
&& go install \
|
||||
-ldflags "-X main.version=$(git describe --tags --always || echo dev)" \
|
||||
-mod=readonly \
|
||||
-modcacherw \
|
||||
-trimpath
|
||||
|
||||
FROM alpine:latest
|
||||
|
||||
LABEL maintainer "Knut Ahlers <knut@ahlers.me>"
|
||||
|
||||
RUN set -ex \
|
||||
&& apk --no-cache add \
|
||||
ca-certificates
|
||||
|
||||
COPY --from=builder /go/bin/mercedes-byocar-exporter /usr/local/bin/mercedes-byocar-exporter
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/mercedes-byocar-exporter"]
|
||||
CMD ["--"]
|
||||
|
||||
# vim: set ft=Dockerfile:
|
Loading…
Reference in a new issue