Skip to content

Commit a54aa3f

Browse files
committed
fix: fix some warnings when building images
1 parent e3f2714 commit a54aa3f

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
ARG BASE_IMAGE
2-
ARG BUILDER_IMAGE
1+
ARG BASE_IMAGE=gcr.io/distroless/static:nonroot
2+
ARG BUILDER_IMAGE=golang:1.23.0
33

44
# Build the manager binary
5-
FROM ${BUILDER_IMAGE} as builder
6-
ARG TARGETOS
7-
ARG TARGETARCH
5+
FROM ${BUILDER_IMAGE} AS builder
6+
ARG TARGETOS=linux
7+
ARG TARGETARCH=amd64
88

99
WORKDIR /workspace
1010
# Copy the Go Modules manifests
@@ -25,7 +25,7 @@ COPY client-go/ client-go/
2525
# was called. For example, if we call make docker-build in a local env which has the Apple Silicon M1 SO
2626
# the docker BUILDPLATFORM arg will be linux/arm64 when for Apple x86 it will be linux/amd64. Therefore,
2727
# by leaving it empty we can ensure that the container and binary shipped on it will have the same platform.
28-
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager cmd/main.go
28+
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -a -o manager cmd/main.go
2929

3030
# Use distroless as minimal base image to package the manager binary
3131
# Refer to https://github.com/GoogleContainerTools/distroless for more details

Dockerfile.loader

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
FROM python:3.10-alpine as builder
1+
FROM python:3.10-alpine AS builder
22

33
WORKDIR /workspace
44

55
COPY pyproject.toml poetry.lock ./
6-
ENV POETRY_VIRTUALENVS_CREATE false
6+
ENV POETRY_VIRTUALENVS_CREATE=false
77

88
RUN apk add --no-cache \
99
build-base \

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ image-build:
187187
$(IMAGE_BUILD_CMD) -t $(IMG) \
188188
--build-arg BASE_IMAGE=$(BASE_IMAGE) \
189189
--build-arg BUILDER_IMAGE=$(BUILDER_IMAGE) \
190-
--build-arg CGO_ENABLED=$(CGO_ENABLED) \
191190
$(IMAGE_BUILD_EXTRA_OPTS) ./
192191
image-load: IMAGE_BUILD_EXTRA_OPTS=--load
193192
image-load: image-build

0 commit comments

Comments
 (0)