From 3b619e832790c5a1d88f8012d5e06142af9a00d6 Mon Sep 17 00:00:00 2001 From: Mike Rostermund Date: Mon, 16 Sep 2024 12:44:15 +0200 Subject: [PATCH] Use alpine images --- Dockerfile | 2 +- images/helper/Dockerfile | 2 +- images/logscale-dummy/Dockerfile | 4 ++-- test.Dockerfile | 7 +++++-- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 50fb1cd80..7e93313f5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Build the manager binary -FROM golang:1.22 AS builder +FROM golang:1.22-alpine AS builder ARG RELEASE_VERSION=master ARG RELEASE_COMMIT=none diff --git a/images/helper/Dockerfile b/images/helper/Dockerfile index 4b5a05681..a35c87926 100644 --- a/images/helper/Dockerfile +++ b/images/helper/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.22 AS builder +FROM golang:1.22-alpine AS builder ARG RELEASE_VERSION=master ARG RELEASE_COMMIT=none diff --git a/images/logscale-dummy/Dockerfile b/images/logscale-dummy/Dockerfile index 78d2f8eb6..023b78bef 100644 --- a/images/logscale-dummy/Dockerfile +++ b/images/logscale-dummy/Dockerfile @@ -1,7 +1,7 @@ -FROM golang:1.22 AS builder +FROM golang:1.22-alpine AS builder WORKDIR /app/humio COPY . /app/humio RUN go run "$(go env GOROOT)/src/crypto/tls/generate_cert.go" -host dummy RUN chmod a+r key.pem -RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /app/humio/dummy /app/humio/*.go \ No newline at end of file +RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /app/humio/dummy /app/humio/*.go diff --git a/test.Dockerfile b/test.Dockerfile index 1dced9ca3..2200ba84d 100644 --- a/test.Dockerfile +++ b/test.Dockerfile @@ -1,8 +1,11 @@ -FROM golang:1.22.2 +# syntax=docker/dockerfile:1.7-labs +FROM golang:1.22.2-alpine + +RUN apk add bash # Create and populate /var/src with the source code for the humio-operator repository RUN mkdir /var/src -COPY ./ /var/src +COPY --exclude=tmp --exclude=bin ./ /var/src WORKDIR /var/src RUN bash -c "rm -rf /var/src/tmp/*"