From 9ea78823b9b6669f73a590917824f5128c079cac Mon Sep 17 00:00:00 2001 From: Dmitry Sergeev Date: Sat, 13 Jul 2024 22:40:37 +0400 Subject: [PATCH] WIP --- .github/workflows/test.yaml | 2 +- docker/ubuntu/Dockerfile | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 docker/ubuntu/Dockerfile diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 3f3bd04..552ae99 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -34,7 +34,7 @@ jobs: cache-from: type=gha cache-to: type=gha,mode=max build-opts: | - - name: main + - name: ubuntu # - name: Test # run: go test ./... -v -covermode=count \ No newline at end of file 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"] +