Skip to content

Commit 113f5b3

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

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

Dockerfile

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
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
8+
ARG CGO_ENABLED=0
89

910
WORKDIR /workspace
1011
# Copy the Go Modules manifests
@@ -25,7 +26,7 @@ COPY client-go/ client-go/
2526
# was called. For example, if we call make docker-build in a local env which has the Apple Silicon M1 SO
2627
# the docker BUILDPLATFORM arg will be linux/arm64 when for Apple x86 it will be linux/amd64. Therefore,
2728
# 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
29+
RUN CGO_ENABLED=${CGO_ENABLED} GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -a -o manager cmd/main.go
2930

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

Dockerfile.loader

+2-2
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

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ GIT_TAG ?= $(shell git describe --tags --dirty --always)
6868
IMG ?= $(IMAGE_REPO):$(GIT_TAG)
6969
BUILDER_IMAGE ?= golang:$(GO_VERSION)
7070
KIND_CLUSTER_NAME ?= kind
71+
CGO_ENABLED ?= 0
7172

7273
LOADER_IMAGE_TAG ?= $(GIT_TAG)
7374
LOADER_IMAGE_REPO = inftyai/model-loader

0 commit comments

Comments
 (0)