-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathDockerfile
27 lines (23 loc) · 938 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# syntax = docker/dockerfile:1.3-labs
ARG VERSION=0.0.0
ARG COMMIT=''
ARG DATE=''
FROM golang:1-alpine as builder
WORKDIR /go/src/mysqlrouter_exporter
COPY . .
RUN apk --no-cache add git openssh build-base
RUN go build -ldflags "-X main.version=${VERSION} -X main.commit=${COMMIT} -X main.date=${DATE}" -o app .
FROM alpine as production
LABEL maintainer="rluisr" \
org.opencontainers.image.url="https://github.com/rluisr/mysqlrouter_exporter" \
org.opencontainers.image.source="https://github.com/rluisr/mysqlrouter_exporter" \
org.opencontainers.image.vendor="rluisr" \
org.opencontainers.image.title="mysqlrouter_exporter" \
org.opencontainers.image.description="Prometheus exporter for MySQL Router." \
org.opencontainers.image.licenses="AGPL"
RUN <<EOF
apk add --no-cache ca-certificates libc6-compat \
rm -rf /var/cache/apk/*
EOF
COPY --from=builder /go/src/mysqlrouter_exporter/app /app
ENTRYPOINT ["/app"]