Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,9 @@ BUILDX_BUILDER_NAME ?= img-builder
QEMU_VERSION ?= 7.2.0-1
BUILDKIT_VERSION ?= v0.18.1

.PHONY: vendor
vendor:
go mod tidy && go mod vendor
.PHONY: tidy
tidy:
go mod tidy

.PHONY: image
image:
Expand Down Expand Up @@ -242,7 +242,7 @@ docker-buildx-builder:
fi

.PHONY: docker-build-hub-net-controller-manager
docker-build-hub-net-controller-manager: docker-buildx-builder vendor
docker-build-hub-net-controller-manager: docker-buildx-builder tidy
docker buildx build \
--file docker/$(HUB_NET_CONTROLLER_MANAGER_IMAGE_NAME).Dockerfile \
--output=$(OUTPUT_TYPE) \
Expand All @@ -254,7 +254,7 @@ docker-build-hub-net-controller-manager: docker-buildx-builder vendor
--build-arg GOOS=$(TARGET_OS) .

.PHONY: docker-build-member-net-controller-manager
docker-build-member-net-controller-manager: docker-buildx-builder vendor
docker-build-member-net-controller-manager: docker-buildx-builder tidy
docker buildx build \
--file docker/$(MEMBER_NET_CONTROLLER_MANAGER_IMAGE_NAME).Dockerfile \
--output=$(OUTPUT_TYPE) \
Expand All @@ -266,7 +266,7 @@ docker-build-member-net-controller-manager: docker-buildx-builder vendor
--build-arg GOOS=$(TARGET_OS) .

.PHONY: docker-build-mcs-controller-manager
docker-build-mcs-controller-manager: docker-buildx-builder vendor
docker-build-mcs-controller-manager: docker-buildx-builder tidy
docker buildx build \
--file docker/$(MCS_CONTROLLER_MANAGER_IMAGE_NAME).Dockerfile \
--output=$(OUTPUT_TYPE) \
Expand All @@ -278,7 +278,7 @@ docker-build-mcs-controller-manager: docker-buildx-builder vendor
--build-arg GOOS=$(TARGET_OS) .

.PHONY: docker-build-net-crd-installer
docker-build-net-crd-installer: docker-buildx-builder vendor
docker-build-net-crd-installer: docker-buildx-builder tidy
docker buildx build \
--file docker/$(NET_CRD_INSTALLER_IMAGE_NAME).Dockerfile \
--output=$(OUTPUT_TYPE) \
Expand Down
10 changes: 5 additions & 5 deletions docker/hub-net-controller-manager.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the hub-net-controller-manager binary
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.24.6 as builder
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.24.6 AS builder

ARG GOOS=linux
ARG GOARCH=amd64
Expand All @@ -8,9 +8,9 @@ WORKDIR /workspace
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
# the go command will load packages from the vendor directory instead of downloading modules from their sources into
# the module cache and using packages those downloaded copies.
COPY vendor/ vendor/
# Cache the downloaded dependency modules across different builds to expedite the progress.
# This also helps reduce downloading related reliability issues in our build environment.
RUN --mount=type=cache,target=/go/pkg/mod go mod download

# Copy the go source
COPY cmd/hub-net-controller-manager/main.go main.go
Expand All @@ -19,7 +19,7 @@ COPY pkg/ pkg/

# Build with CGO enabled and GOEXPERIMENT=systemcrypto for internal usage
RUN echo "Building images with GOOS=$GOOS GOARCH=$GOARCH"
RUN CGO_ENABLED=1 GOOS=$GOOS GOARCH=$GOARCH GOEXPERIMENT=systemcrypto GO111MODULE=on go build -o hub-net-controller-manager main.go
RUN --mount=type=cache,target=/go/pkg/mod CGO_ENABLED=1 GOOS=$GOOS GOARCH=$GOARCH GOEXPERIMENT=systemcrypto GO111MODULE=on go build -o hub-net-controller-manager main.go

# Use Azure Linux distroless base image to package hub-net-controller-manager binary
# Refer to https://mcr.microsoft.com/en-us/artifact/mar/azurelinux/distroless/base/about for more details
Expand Down
10 changes: 5 additions & 5 deletions docker/mcs-controller-manager.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the mcs-controller-manager binary
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.24.6 as builder
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.24.6 AS builder

ARG GOOS=linux
ARG GOARCH=amd64
Expand All @@ -8,9 +8,9 @@ WORKDIR /workspace
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
# the go command will load packages from the vendor directory instead of downloading modules from their sources into
# the module cache and using packages those downloaded copies.
COPY vendor/ vendor/
# Cache the downloaded dependency modules across different builds to expedite the progress.
# This also helps reduce downloading related reliability issues in our build environment.
RUN --mount=type=cache,target=/go/pkg/mod go mod download

# Copy the go source
COPY cmd/mcs-controller-manager/main.go main.go
Expand All @@ -19,7 +19,7 @@ COPY pkg/ pkg/

# Build with CGO enabled and GOEXPERIMENT=systemcrypto for internal usage
RUN echo "Building images with GOOS=$GOOS GOARCH=$GOARCH"
RUN CGO_ENABLED=1 GOOS=$GOOS GOARCH=$GOARCH GOEXPERIMENT=systemcrypto GO111MODULE=on go build -o mcs-controller-manager main.go
RUN --mount=type=cache,target=/go/pkg/mod CGO_ENABLED=1 GOOS=$GOOS GOARCH=$GOARCH GOEXPERIMENT=systemcrypto GO111MODULE=on go build -o mcs-controller-manager main.go

# Use Azure Linux distroless base image to package mcs-controller-manager binary
# Refer to https://mcr.microsoft.com/en-us/artifact/mar/azurelinux/distroless/base/about for more details
Expand Down
10 changes: 5 additions & 5 deletions docker/member-net-controller-manager.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the member-net-controller-manager binary
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.24.6 as builder
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.24.6 AS builder
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it case sensitive?


ARG GOOS=linux
ARG GOARCH=amd64
Expand All @@ -8,9 +8,9 @@ WORKDIR /workspace
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
# the go command will load packages from the vendor directory instead of downloading modules from their sources into
# the module cache and using packages those downloaded copies.
COPY vendor/ vendor/
# Cache the downloaded dependency modules across different builds to expedite the progress.
# This also helps reduce downloading related reliability issues in our build environment.
RUN --mount=type=cache,target=/go/pkg/mod go mod download

# Copy the go source
COPY cmd/member-net-controller-manager/main.go main.go
Expand All @@ -19,7 +19,7 @@ COPY pkg/ pkg/

# Build with CGO enabled and GOEXPERIMENT=systemcrypto for internal usage
RUN echo "Building images with GOOS=$GOOS GOARCH=$GOARCH"
RUN CGO_ENABLED=1 GOOS=$GOOS GOARCH=$GOARCH GOEXPERIMENT=systemcrypto GO111MODULE=on go build -o member-net-controller-manager main.go
RUN --mount=type=cache,target=/go/pkg/mod CGO_ENABLED=1 GOOS=$GOOS GOARCH=$GOARCH GOEXPERIMENT=systemcrypto GO111MODULE=on go build -o member-net-controller-manager main.go

# Use Azure Linux distroless base image to package member-net-controller-manager binary
# Refer to https://mcr.microsoft.com/en-us/artifact/mar/azurelinux/distroless/base/about for more details
Expand Down
8 changes: 4 additions & 4 deletions docker/net-crd-installer.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ WORKDIR /workspace
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
RUN go mod download
# Cache the downloaded dependency modules across different builds to expedite the progress.
# This also helps reduce downloading related reliability issues in our build environment.
RUN --mount=type=cache,target=/go/pkg/mod go mod download

# Copy the go source
COPY cmd/net-crd-installer/ cmd/net-crd-installer/

# Build with CGO enabled and GOEXPERIMENT=systemcrypto for internal usage
RUN echo "Building images with GOOS=linux GOARCH=$GOARCH"
RUN CGO_ENABLED=1 GOOS=linux GOARCH=$GOARCH GOEXPERIMENT=systemcrypto GO111MODULE=on go build -o net-crd-installer cmd/net-crd-installer/main.go
RUN --mount=type=cache,target=/go/pkg/mod CGO_ENABLED=1 GOOS=linux GOARCH=$GOARCH GOEXPERIMENT=systemcrypto GO111MODULE=on go build -o net-crd-installer cmd/net-crd-installer/main.go

# Use Azure Linux distroless base image to package net-crd-installer binary
# Refer to https://mcr.microsoft.com/en-us/artifact/mar/azurelinux/distroless/base/about for more details
Expand Down
Loading