-
Notifications
You must be signed in to change notification settings - Fork 236
/
Dockerfile
35 lines (24 loc) · 926 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
27
28
29
30
31
32
33
34
35
ARG BASE_IMAGE
# Build is starting here
FROM docker.io/library/golang:1.22 AS build
WORKDIR /go/src/oracledb_exporter
COPY . .
RUN go get -d -v
ARG VERSION
ENV VERSION ${VERSION:-0.1.0}
ARG CGO_ENABLED
ENV CGO_ENABLED ${CGO_ENABLED:-1}
RUN CGO_ENABLED=${CGO_ENABLED} GOOS=linux GOARCH=amd64 go build -v -ldflags "-X main.Version=${VERSION} -s -w"
FROM ${BASE_IMAGE} as exporter
LABEL org.opencontainers.image.authors="Seth Miller,Yannig Perré <[email protected]>"
LABEL org.opencontainers.image.description="Oracle DB Exporter"
ENV VERSION ${VERSION:-0.1.0}
ENV DEBIAN_FRONTEND=noninteractive
ARG LEGACY_TABLESPACE
ENV LEGACY_TABLESPACE=${LEGACY_TABLESPACE}
COPY --from=build /go/src/oracledb_exporter/oracledb_exporter /oracledb_exporter
ADD ./default-metrics${LEGACY_TABLESPACE}.toml /default-metrics.toml
ENV DATA_SOURCE_NAME system/oracle@oracle/xe
EXPOSE 9161
USER 1000
ENTRYPOINT ["/oracledb_exporter"]