-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
👷 Update packages versions + clean up
* Update packages versions + clean up * Use Oracle image to retrieve binaries * Use FQN for docker image
- Loading branch information
Showing
7 changed files
with
58 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
FROM golang:1.19 AS build | ||
FROM docker.io/library/golang:1.19 AS build | ||
|
||
ARG ORACLE_VERSION | ||
ENV ORACLE_VERSION=${ORACLE_VERSION} | ||
ARG MAJOR_VERSION | ||
ENV MAJOR_VERSION=${MAJOR_VERSION} | ||
ENV LD_LIBRARY_PATH "/usr/lib/oracle/${MAJOR_VERSION}/client64/lib" | ||
|
||
RUN apt-get -qq update && apt-get install -y --no-install-recommends -qq libaio1 alien && rm -rf /var/lib/apt/lists/* | ||
COPY oracle*${ORACLE_VERSION}*.rpm / | ||
RUN alien -i --scripts /oracle*.rpm && rm /*.rpm | ||
# Can't use a variable to refer to external image. So using image name | ||
COPY --from=ghcr.io/oracle/oraclelinux8-instantclient:21 /usr/lib/oracle /usr/lib/oracle | ||
COPY --from=ghcr.io/oracle/oraclelinux8-instantclient:21 /usr/share/oracle /usr/share/oracle | ||
COPY --from=ghcr.io/oracle/oraclelinux8-instantclient:21 /usr/include/oracle /usr/include/oracle | ||
|
||
COPY oci8.pc.template /usr/share/pkgconfig/oci8.pc | ||
RUN sed -i "s/@ORACLE_VERSION@/$ORACLE_VERSION/g" /usr/share/pkgconfig/oci8.pc && \ | ||
|
@@ -27,26 +28,27 @@ ENV PKG_CONFIG_PATH /go/src/oracledb_exporter | |
|
||
RUN GOOS=linux GOARCH=amd64 go build -v -ldflags "-X main.Version=${VERSION} -s -w" | ||
|
||
FROM ubuntu:22.10 | ||
FROM docker.io/library/ubuntu:22.10 | ||
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 | ||
|
||
COPY oracle-instantclient*${ORACLE_VERSION}*basic*.rpm / | ||
|
||
# We only need lib directory | ||
COPY --from=build /usr/lib/oracle /usr/lib/oracle | ||
RUN apt-get -qq update && \ | ||
apt-get -qq install -y --no-install-recommends tzdata libaio1 alien && \ | ||
alien -i --scripts /oracle*.rpm && \ | ||
rm -f /oracle*.rpm && rm -rf /var/lib/apt/lists/* | ||
apt-get -qq install -y --no-install-recommends tzdata libaio1 && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
RUN adduser --system --uid 1000 --group appuser \ | ||
&& usermod -a -G 0,appuser appuser | ||
|
||
ARG ORACLE_VERSION | ||
ENV ORACLE_VERSION=${ORACLE_VERSION} | ||
ENV LD_LIBRARY_PATH "/usr/lib/oracle/${ORACLE_VERSION}/client64/lib" | ||
ARG MAJOR_VERSION | ||
ENV MAJOR_VERSION=${MAJOR_VERSION} | ||
ENV LD_LIBRARY_PATH "/usr/lib/oracle/${MAJOR_VERSION}/client64/lib" | ||
RUN echo $LD_LIBRARY_PATH >> /etc/ld.so.conf.d/oracle.conf && ldconfig | ||
|
||
ARG LEGACY_TABLESPACE | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
FROM golang:1.19 AS build | ||
FROM docker.io/library/golang:1.19 AS build | ||
|
||
ARG ORACLE_VERSION | ||
ENV ORACLE_VERSION=${ORACLE_VERSION} | ||
ARG MAJOR_VERSION | ||
ENV MAJOR_VERSION=${MAJOR_VERSION} | ||
ENV LD_LIBRARY_PATH "/usr/lib/oracle/${MAJOR_VERSION}/client64/lib" | ||
|
||
RUN apt-get -qq update && apt-get install -y --no-install-recommends -qq libaio1 rpm && rm -rf /var/lib/apt/lists/* | ||
COPY oracle*${ORACLE_VERSION}*.rpm / | ||
RUN rpm -Uh --nodeps /oracle-instantclient*.x86_64.rpm && rm /*.rpm | ||
# Can't use a variable to refer to external image. So using image name | ||
COPY --from=ghcr.io/oracle/oraclelinux8-instantclient:21 /usr/lib/oracle /usr/lib/oracle | ||
COPY --from=ghcr.io/oracle/oraclelinux8-instantclient:21 /usr/share/oracle /usr/share/oracle | ||
COPY --from=ghcr.io/oracle/oraclelinux8-instantclient:21 /usr/include/oracle /usr/include/oracle | ||
|
||
COPY oci8.pc.template /usr/share/pkgconfig/oci8.pc | ||
RUN sed -i "s/@ORACLE_VERSION@/$ORACLE_VERSION/g" /usr/share/pkgconfig/oci8.pc && \ | ||
|
@@ -27,7 +28,7 @@ ENV PKG_CONFIG_PATH /go/src/oracledb_exporter | |
|
||
RUN GOOS=linux GOARCH=amd64 go build -v -ldflags "-X main.Version=${VERSION} -s -w" | ||
|
||
FROM frolvlad/alpine-glibc:glibc-2.35 | ||
FROM docker.io/frolvlad/alpine-glibc:glibc-2.35 | ||
LABEL authors="Seth Miller,Yannig Perré" | ||
LABEL maintainer="Yannig Perré <[email protected]>" | ||
|
||
|
@@ -37,6 +38,7 @@ RUN apk add libaio --no-cache | |
|
||
ARG LEGACY_TABLESPACE | ||
ENV LEGACY_TABLESPACE=${LEGACY_TABLESPACE} | ||
# We only need lib directory | ||
COPY --from=build /usr/lib/oracle /usr/lib/oracle | ||
COPY --from=build /go/src/oracledb_exporter/oracledb_exporter /oracledb_exporter | ||
ADD ./default-metrics${LEGACY_TABLESPACE}.toml /default-metrics.toml | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters