diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 11e260f..7ed28f5 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -59,6 +59,7 @@ jobs: repo-image-name: true latest: true - name: alpine + - name: ubuntu release: name: release diff --git a/docker/ubuntu/Dockerfile b/docker/ubuntu/Dockerfile new file mode 100644 index 0000000..b8dbadd --- /dev/null +++ b/docker/ubuntu/Dockerfile @@ -0,0 +1,22 @@ +FROM docker.io/golang:1.22 AS build + +WORKDIR /app + +COPY go.mod go.sum ./ +RUN go mod download + +COPY ./main.go ./ +COPY ./pkg ./pkg + +RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o ./custom-exporter . + +FROM docker.io/ubuntu:24.04 +ENV DEBIAN_FRONTEND=noninteractive +RUN apt-get update \ + && apt-get install --no-install-recommends -y ca-certificates \ + && apt-get autoclean \ + && apt-get --purge autoremove \ + && rm -rf /var/lib/apt/lists/* +COPY --from=build /app/custom-exporter /custom-exporter +ENTRYPOINT ["/custom-exporter"] +