From b700df32eb03dbef5021f7debb20f1f11a94a4c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niccol=C3=B2=20Fei?= Date: Thu, 24 Oct 2024 11:08:12 +0200 Subject: [PATCH] ci: testing things MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Niccolò Fei --- Taskfile.yml | 4 ++-- containers/Dockerfile.plugin | 3 +-- containers/Dockerfile.sidecar | 3 +-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Taskfile.yml b/Taskfile.yml index ec31d77..d4812ef 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -127,12 +127,12 @@ tasks: - > dagger -s call -m github.com/purpleclay/daggerverse/docker@${DAGGER_DOCKER_SHA} --registry ghcr.io --username $REGISTRY_USER --password env:REGISTRY_PASSWORD - build --dir . --file containers/Dockerfile.plugin --platform linux/amd64 --platform linux/arm64 + build --dir . --file containers/Dockerfile.plugin --platform linux/amd64,linux/arm64 publish --ref {{.PLUGIN_IMAGE_NAME}} --tags {{.IMAGE_VERSION}} - > dagger -s call -m github.com/purpleclay/daggerverse/docker@${DAGGER_DOCKER_SHA} --registry ghcr.io --username $REGISTRY_USER --password env:REGISTRY_PASSWORD - build --dir . --file containers/Dockerfile.sidecar --platform linux/amd64 --platform linux/arm64 + build --dir . --file containers/Dockerfile.sidecar --platform linux/amd64,linux/arm64 publish --ref {{.SIDECAR_IMAGE_NAME}} --tags {{.IMAGE_VERSION}} manifest: diff --git a/containers/Dockerfile.plugin b/containers/Dockerfile.plugin index 500c535..333d039 100644 --- a/containers/Dockerfile.plugin +++ b/containers/Dockerfile.plugin @@ -21,8 +21,7 @@ COPY ../internal internal/ # was called. For example, if we call make docker-build in a local env which has the Apple Silicon M1 SO # the docker BUILDPLATFORM arg will be linux/arm64 when for Apple x86 it will be linux/amd64. Therefore, # by leaving it empty we can ensure that the container and binary shipped on it will have the same platform. -RUN --mount=type=cache,target=/go/pkg/mod --mount=type=cache,target=/root/.cache/go-build \ - CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager cmd/operator/main.go +RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -o manager cmd/operator/main.go # Use distroless as minimal base image to package the manager binary # Refer to https://github.com/GoogleContainerTools/distroless for more details diff --git a/containers/Dockerfile.sidecar b/containers/Dockerfile.sidecar index 6093f94..fe04f70 100644 --- a/containers/Dockerfile.sidecar +++ b/containers/Dockerfile.sidecar @@ -27,8 +27,7 @@ ENV CGO_ENABLED=0 COPY .. /src ARG TARGETOS ARG TARGETARCH -RUN --mount=type=cache,target=/go/pkg/mod --mount=type=cache,target=/root/.cache/go-build \ - GOOS=$TARGETOS GOARCH=$TARGETARCH go build -C /src -o /build/instance /src/cmd/instance/main.go +RUN GOOS=$TARGETOS GOARCH=$TARGETARCH go build -C /src -o /build/instance /src/cmd/instance/main.go # Joint process # Now we put everything that was build from the origin into our