Skip to content
Open
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
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG VARIANT="1.24"
ARG VARIANT="1.26"
FROM mcr.microsoft.com/vscode/devcontainers/go:${VARIANT}
RUN apt-get update && \
export DEBIAN_FRONTEND=noninteractive && \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
ARG ARCH

# mcr.microsoft.com/azurelinux/base/core:3.0
FROM mcr.microsoft.com/azurelinux/base/core@sha256:35149ae8dd179684f969944f54a337c665a64e702486154eb44253fb39c2505b AS mariner-core
FROM mcr.microsoft.com/azurelinux/base/core@sha256:2d83ae6e0d21cd58973633948d903038679f70fb594d6565626f29ddc162fe0c AS mariner-core

# mcr.microsoft.com/azurelinux/distroless/base:3.0
FROM mcr.microsoft.com/azurelinux/distroless/base@sha256:32820d2cf20e896aa9111742dd683dd0ccff370f742e256889bb3bb50320c0d4 AS mariner-distroless
FROM mcr.microsoft.com/azurelinux/distroless/base@sha256:60a4f5539feea275365474c3600bba9c426872c5a86f80755acd169618da335e AS mariner-distroless

FROM mariner-core AS iptools
RUN tdnf install -y iptables iproute
Expand Down
4 changes: 2 additions & 2 deletions .pipelines/build/dockerfiles/cns.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ ENTRYPOINT ["azure-cns.exe"]
EXPOSE 10090

# mcr.microsoft.com/azurelinux/base/core:3.0
FROM --platform=linux/${ARCH} mcr.microsoft.com/azurelinux/base/core@sha256:35149ae8dd179684f969944f54a337c665a64e702486154eb44253fb39c2505b AS build-helper
FROM --platform=linux/${ARCH} mcr.microsoft.com/azurelinux/base/core@sha256:2d83ae6e0d21cd58973633948d903038679f70fb594d6565626f29ddc162fe0c AS build-helper
RUN tdnf install -y iptables

# mcr.microsoft.com/azurelinux/distroless/base:3.0
FROM --platform=linux/${ARCH} mcr.microsoft.com/azurelinux/distroless/base@sha256:32820d2cf20e896aa9111742dd683dd0ccff370f742e256889bb3bb50320c0d4 AS linux
FROM --platform=linux/${ARCH} mcr.microsoft.com/azurelinux/distroless/base@sha256:60a4f5539feea275365474c3600bba9c426872c5a86f80755acd169618da335e AS linux
ARG ARTIFACT_DIR .

COPY --from=build-helper /usr/sbin/*tables* /usr/sbin/
Expand Down
2 changes: 2 additions & 0 deletions .pipelines/build/scripts/azure-ip-masq-merger.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ set -eux
FILE_EXT=''

export CGO_ENABLED=0
# Go 1.26 Linux-only: use nocgo OpenSSL backend (systemcrypto default requires CGO)
export GOEXPERIMENT=ms_nocgo_opensslcrypto

Comment on lines 7 to 10
mkdir -p "$OUT_DIR"/bin
mkdir -p "$OUT_DIR"/files
Expand Down
2 changes: 2 additions & 0 deletions .pipelines/build/scripts/azure-ipam.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ set -eux
[[ $OS =~ windows ]] && FILE_EXT='.exe' || FILE_EXT=''

export CGO_ENABLED=0
# Go 1.26 on Linux: systemcrypto is default but requires CGO; use nocgo backend instead
[[ ! $OS =~ windows ]] && export GOEXPERIMENT=ms_nocgo_opensslcrypto

mkdir -p "$OUT_DIR"/bin
mkdir -p "$OUT_DIR"/files
Expand Down
2 changes: 2 additions & 0 deletions .pipelines/build/scripts/azure-iptables-monitor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ set -eux
FILE_EXT=''

export CGO_ENABLED=0
# Go 1.26 Linux-only: use nocgo OpenSSL backend (systemcrypto default requires CGO)
export GOEXPERIMENT=ms_nocgo_opensslcrypto
export C_INCLUDE_PATH=/usr/include/bpf
Comment on lines 7 to 10

mkdir -p "$OUT_DIR"/bin
Expand Down
1 change: 1 addition & 0 deletions .pipelines/build/scripts/cilium-log-collector.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ set -eux
[[ $OS =~ windows ]] && { echo "cilium-log-collector is not supported on Windows"; exit 1; }
# enable cgo for -buildmode=c-shared
export CGO_ENABLED=1
export GOEXPERIMENT=systemcrypto

mkdir -p "$OUT_DIR"/bin
mkdir -p "$OUT_DIR"/files
Expand Down
2 changes: 2 additions & 0 deletions .pipelines/build/scripts/cni.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ mkdir -p "$OUT_DIR"/files
mkdir -p "$OUT_DIR"/bin

export CGO_ENABLED=0
# Go 1.26 on Linux: systemcrypto is default but requires CGO; use nocgo backend instead
[[ ! $OS =~ windows ]] && export GOEXPERIMENT=ms_nocgo_opensslcrypto


CNI_NET_DIR="$REPO_ROOT"/cni/network/plugin
Expand Down
2 changes: 2 additions & 0 deletions .pipelines/build/scripts/cns.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ set -eux
[[ $OS =~ windows ]] && FILE_EXT='.exe' || FILE_EXT=''

export CGO_ENABLED=0
# Go 1.26 on Linux: systemcrypto is default but requires CGO; use nocgo backend instead
[[ ! $OS =~ windows ]] && export GOEXPERIMENT=ms_nocgo_opensslcrypto

mkdir -p "$OUT_DIR"/files
mkdir -p "$OUT_DIR"/bin
Expand Down
2 changes: 2 additions & 0 deletions .pipelines/build/scripts/dropgz.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ function files::remove_exe_extensions() {
[[ $OS =~ windows ]] && FILE_EXT='.exe' || FILE_EXT=''

export CGO_ENABLED=0
# Go 1.26 on Linux: systemcrypto is default but requires CGO; use nocgo backend instead
[[ ! $OS =~ windows ]] && export GOEXPERIMENT=ms_nocgo_opensslcrypto

mkdir -p "$GEN_DIR"
mkdir -p "$OUT_DIR"/bin
Expand Down
4 changes: 2 additions & 2 deletions .pipelines/build/scripts/install-go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ set -eux
# 3. Hardcoded fallback digest below
#
# To update the fallback, run:
# skopeo inspect docker://mcr.microsoft.com/oss/go/microsoft/golang:1.24-azurelinux3.0 --format "{{.Name}}@{{.Digest}}"
DEFAULT_IMAGE="mcr.microsoft.com/oss/go/microsoft/golang@sha256:3999f970bb52b7413ef9be2803173d4fd7f1f3c59362a98a0c78d155e3a0e59f"
# skopeo inspect docker://mcr.microsoft.com/oss/go/microsoft/golang:1.26-azurelinux3.0 --format "{{.Name}}@{{.Digest}}"
DEFAULT_IMAGE="mcr.microsoft.com/oss/go/microsoft/golang@sha256:5f95bf70f4c437de4a6ba1f72ef1532f69fca392c131fff2172993cabbea359c"
Comment on lines +14 to +15
Comment on lines 13 to +15

# Resolves the golang image from the source Dockerfile for the given $name.
# Echoes the image reference, or empty string if it cannot be determined.
Expand Down
2 changes: 2 additions & 0 deletions .pipelines/build/scripts/ipv6-hp-bpf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ function findcp::shared_library() {
[[ $OS =~ windows ]] && FILE_EXT='.exe' || FILE_EXT=''

export CGO_ENABLED=0
# Go 1.26 Linux-only: use nocgo OpenSSL backend (systemcrypto default requires CGO)
export GOEXPERIMENT=ms_nocgo_opensslcrypto
export C_INCLUDE_PATH=/usr/include/bpf
Comment on lines 40 to 43

mkdir -p "$OUT_DIR"/bin
Expand Down
2 changes: 2 additions & 0 deletions .pipelines/build/scripts/npm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ set -eux
[[ $OS =~ windows ]] && FILE_EXT='.exe' || FILE_EXT=''

export CGO_ENABLED=0
# Go 1.26 on Linux: systemcrypto is default but requires CGO; use nocgo backend instead
[[ ! $OS =~ windows ]] && export GOEXPERIMENT=ms_nocgo_opensslcrypto

mkdir -p "$OUT_DIR"/files
mkdir -p "$OUT_DIR"/bin
Expand Down
42 changes: 24 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ ARCHIVE_EXT = zip
EXE_EXT = .exe
endif

# Go 1.26 on Linux: systemcrypto (default) requires CGO; use nocgo OpenSSL backend for CGO_ENABLED=0 builds
# Only applied to binary build targets, not tooling (renderkit, mockgen, etc.)
ifneq ($(GOOS),windows)
ACN_GOEXPERIMENT := ms_nocgo_opensslcrypto
endif
Comment on lines +35 to +39
Comment on lines +35 to +39

# Interrogate the git repo and set some variables
REPO_ROOT ?= $(shell git rev-parse --show-toplevel)
REVISION ?= $(shell git rev-parse --short HEAD)
Expand Down Expand Up @@ -115,7 +121,7 @@ CNS_IMAGE_INFO_FILE = azure-cns-$(CNS_VERSION).txt
NPM_IMAGE_INFO_FILE = azure-npm-$(NPM_VERSION).txt

#Tools paths
TOOLS_GO_MOD = $(REPO_ROOT)/tools.go.mod
TOOLS_GO_MOD = $(REPO_ROOT)/tools-go/go.mod

# Default target
all-binaries-platforms: ## Make all platform binaries
Expand Down Expand Up @@ -188,12 +194,12 @@ zapai-version: ## prints the zapai version

# Build the delegated IPAM plugin binary.
azure-ipam-binary:
cd $(AZURE_IPAM_DIR) && CGO_ENABLED=0 go build -v -o $(AZURE_IPAM_BUILD_DIR)/azure-ipam$(EXE_EXT) -ldflags "-X github.com/Azure/azure-container-networking/azure-ipam/internal/buildinfo.Version=$(AZURE_IPAM_VERSION) $(LD_BUILD_FLAGS)" -gcflags="-dwarflocationlists=true"
cd $(AZURE_IPAM_DIR) && CGO_ENABLED=0 GOEXPERIMENT=$(ACN_GOEXPERIMENT) go build -v -o $(AZURE_IPAM_BUILD_DIR)/azure-ipam$(EXE_EXT) -ldflags "-X github.com/Azure/azure-container-networking/azure-ipam/internal/buildinfo.Version=$(AZURE_IPAM_VERSION) $(LD_BUILD_FLAGS)" -gcflags="-dwarflocationlists=true"

# Build the ipv6-hp-bpf binary.
ipv6-hp-bpf-binary: bpf-lib
cd $(IPV6_HP_BPF_DIR) && CGO_ENABLED=0 go generate ./...
cd $(IPV6_HP_BPF_DIR)/cmd/ipv6-hp-bpf && CGO_ENABLED=0 go build -v -o $(IPV6_HP_BPF_BUILD_DIR)/ipv6-hp-bpf$(EXE_EXT) -ldflags "-X main.version=$(IPV6_HP_BPF_VERSION) $(LD_BUILD_FLAGS)" -gcflags="-dwarflocationlists=true"
cd $(IPV6_HP_BPF_DIR) && CGO_ENABLED=0 GOEXPERIMENT=$(ACN_GOEXPERIMENT) go generate ./...
cd $(IPV6_HP_BPF_DIR)/cmd/ipv6-hp-bpf && CGO_ENABLED=0 GOEXPERIMENT=$(ACN_GOEXPERIMENT) go build -v -o $(IPV6_HP_BPF_BUILD_DIR)/ipv6-hp-bpf$(EXE_EXT) -ldflags "-X main.version=$(IPV6_HP_BPF_VERSION) $(LD_BUILD_FLAGS)" -gcflags="-dwarflocationlists=true"

# Libraries for bpf
bpf-lib:
Expand All @@ -207,54 +213,54 @@ endif

# Build the azure-block-iptables binary.
azure-block-iptables-binary: bpf-lib
cd $(AZURE_BLOCK_IPTABLES_DIR) && CGO_ENABLED=0 go generate ./...
cd $(AZURE_BLOCK_IPTABLES_DIR)/cmd/azure-block-iptables && CGO_ENABLED=0 go build -v -o $(AZURE_BLOCK_IPTABLES_BUILD_DIR)/azure-block-iptables$(EXE_EXT) -ldflags "-X main.version=$(AZURE_BLOCK_IPTABLES_VERSION)" -gcflags="-dwarflocationlists=true"
cd $(AZURE_BLOCK_IPTABLES_DIR) && CGO_ENABLED=0 GOEXPERIMENT=$(ACN_GOEXPERIMENT) go generate ./...
cd $(AZURE_BLOCK_IPTABLES_DIR)/cmd/azure-block-iptables && CGO_ENABLED=0 GOEXPERIMENT=$(ACN_GOEXPERIMENT) go build -v -o $(AZURE_BLOCK_IPTABLES_BUILD_DIR)/azure-block-iptables$(EXE_EXT) -ldflags "-X main.version=$(AZURE_BLOCK_IPTABLES_VERSION)" -gcflags="-dwarflocationlists=true"

# Build the Azure CNI network binary.
azure-vnet-binary:
cd $(CNI_NET_DIR) && CGO_ENABLED=0 go build -v -o $(CNI_BUILD_DIR)/azure-vnet$(EXE_EXT) -ldflags "-X main.version=$(CNI_VERSION) $(LD_BUILD_FLAGS)" -gcflags="-dwarflocationlists=true"
cd $(CNI_NET_DIR) && CGO_ENABLED=0 GOEXPERIMENT=$(ACN_GOEXPERIMENT) go build -v -o $(CNI_BUILD_DIR)/azure-vnet$(EXE_EXT) -ldflags "-X main.version=$(CNI_VERSION) $(LD_BUILD_FLAGS)" -gcflags="-dwarflocationlists=true"

# Build the Azure CNI stateless network binary
azure-vnet-stateless-binary:
cd $(STATELESS_CNI_NET_DIR) && CGO_ENABLED=0 go build -v -o $(STATELESS_CNI_BUILD_DIR)/azure-vnet$(EXE_EXT) -ldflags "-X main.version=$(CNI_VERSION) $(LD_BUILD_FLAGS)" -gcflags="-dwarflocationlists=true"
cd $(STATELESS_CNI_NET_DIR) && CGO_ENABLED=0 GOEXPERIMENT=$(ACN_GOEXPERIMENT) go build -v -o $(STATELESS_CNI_BUILD_DIR)/azure-vnet$(EXE_EXT) -ldflags "-X main.version=$(CNI_VERSION) $(LD_BUILD_FLAGS)" -gcflags="-dwarflocationlists=true"

# Build the Azure CNI IPAM binary.
azure-vnet-ipam-binary:
cd $(CNI_IPAM_DIR) && CGO_ENABLED=0 go build -v -o $(CNI_BUILD_DIR)/azure-vnet-ipam$(EXE_EXT) -ldflags "-X main.version=$(CNI_VERSION) $(LD_BUILD_FLAGS)" -gcflags="-dwarflocationlists=true"
cd $(CNI_IPAM_DIR) && CGO_ENABLED=0 GOEXPERIMENT=$(ACN_GOEXPERIMENT) go build -v -o $(CNI_BUILD_DIR)/azure-vnet-ipam$(EXE_EXT) -ldflags "-X main.version=$(CNI_VERSION) $(LD_BUILD_FLAGS)" -gcflags="-dwarflocationlists=true"

# Build the Azure CNI IPAMV6 binary.
azure-vnet-ipamv6-binary:
cd $(CNI_IPAMV6_DIR) && CGO_ENABLED=0 go build -v -o $(CNI_BUILD_DIR)/azure-vnet-ipamv6$(EXE_EXT) -ldflags "-X main.version=$(CNI_VERSION) $(LD_BUILD_FLAGS)" -gcflags="-dwarflocationlists=true"
cd $(CNI_IPAMV6_DIR) && CGO_ENABLED=0 GOEXPERIMENT=$(ACN_GOEXPERIMENT) go build -v -o $(CNI_BUILD_DIR)/azure-vnet-ipamv6$(EXE_EXT) -ldflags "-X main.version=$(CNI_VERSION) $(LD_BUILD_FLAGS)" -gcflags="-dwarflocationlists=true"

# Build the Azure CNI telemetry binary.
azure-vnet-telemetry-binary:
cd $(CNI_TELEMETRY_DIR) && CGO_ENABLED=0 go build -v -o $(CNI_BUILD_DIR)/azure-vnet-telemetry$(EXE_EXT) -ldflags "-X main.version=$(CNI_VERSION) -X $(CNI_AI_PATH)=$(CNI_AI_ID) $(LD_BUILD_FLAGS)" -gcflags="-dwarflocationlists=true"
cd $(CNI_TELEMETRY_DIR) && CGO_ENABLED=0 GOEXPERIMENT=$(ACN_GOEXPERIMENT) go build -v -o $(CNI_BUILD_DIR)/azure-vnet-telemetry$(EXE_EXT) -ldflags "-X main.version=$(CNI_VERSION) -X $(CNI_AI_PATH)=$(CNI_AI_ID) $(LD_BUILD_FLAGS)" -gcflags="-dwarflocationlists=true"

# Build the Azure CNI telemetry sidecar binary.
azure-cni-telemetry-sidecar-binary:
$(MKDIR) $(CNI_BUILD_DIR)
cd $(CNI_TELEMETRY_SIDECAR_DIR) && CGO_ENABLED=0 go build -v -o $(CNI_BUILD_DIR)/azure-cni-telemetry-sidecar$(EXE_EXT) -ldflags "-X main.version=$(CNI_VERSION) -X $(CNI_AI_PATH)=$(CNI_AI_ID) $(LD_BUILD_FLAGS)" -gcflags="-dwarflocationlists=true"
cd $(CNI_TELEMETRY_SIDECAR_DIR) && CGO_ENABLED=0 GOEXPERIMENT=$(ACN_GOEXPERIMENT) go build -v -o $(CNI_BUILD_DIR)/azure-cni-telemetry-sidecar$(EXE_EXT) -ldflags "-X main.version=$(CNI_VERSION) -X $(CNI_AI_PATH)=$(CNI_AI_ID) $(LD_BUILD_FLAGS)" -gcflags="-dwarflocationlists=true"

# Build the Azure CLI network binary.
acncli-binary:
cd $(ACNCLI_DIR) && CGO_ENABLED=0 go build -v -o $(ACNCLI_BUILD_DIR)/acn$(EXE_EXT) -ldflags "-X main.version=$(ACN_VERSION) $(LD_BUILD_FLAGS)" -gcflags="-dwarflocationlists=true"
cd $(ACNCLI_DIR) && CGO_ENABLED=0 GOEXPERIMENT=$(ACN_GOEXPERIMENT) go build -v -o $(ACNCLI_BUILD_DIR)/acn$(EXE_EXT) -ldflags "-X main.version=$(ACN_VERSION) $(LD_BUILD_FLAGS)" -gcflags="-dwarflocationlists=true"

# Build the Azure CNS binary.
azure-cns-binary:
cd $(CNS_DIR) && CGO_ENABLED=0 go build -v -o $(CNS_BUILD_DIR)/azure-cns$(EXE_EXT) -ldflags "-X main.version=$(CNS_VERSION) -X $(CNS_AI_PATH)=$(CNS_AI_ID) -X $(CNI_AI_PATH)=$(CNI_AI_ID) $(LD_BUILD_FLAGS)" -gcflags="-dwarflocationlists=true"
cd $(CNS_DIR) && CGO_ENABLED=0 GOEXPERIMENT=$(ACN_GOEXPERIMENT) go build -v -o $(CNS_BUILD_DIR)/azure-cns$(EXE_EXT) -ldflags "-X main.version=$(CNS_VERSION) -X $(CNS_AI_PATH)=$(CNS_AI_ID) -X $(CNI_AI_PATH)=$(CNI_AI_ID) $(LD_BUILD_FLAGS)" -gcflags="-dwarflocationlists=true"

# Build the Azure NPM binary.
azure-npm-binary:
cd $(CNI_TELEMETRY_DIR) && CGO_ENABLED=0 go build -v -o $(NPM_BUILD_DIR)/azure-vnet-telemetry$(EXE_EXT) -ldflags "-X main.version=$(NPM_VERSION) $(LD_BUILD_FLAGS)" -gcflags="-dwarflocationlists=true"
cd $(NPM_DIR) && CGO_ENABLED=0 go build -v -o $(NPM_BUILD_DIR)/azure-npm$(EXE_EXT) -ldflags "-X main.version=$(NPM_VERSION) -X $(NPM_AI_PATH)=$(NPM_AI_ID) $(LD_BUILD_FLAGS)" -gcflags="-dwarflocationlists=true"
cd $(CNI_TELEMETRY_DIR) && CGO_ENABLED=0 GOEXPERIMENT=$(ACN_GOEXPERIMENT) go build -v -o $(NPM_BUILD_DIR)/azure-vnet-telemetry$(EXE_EXT) -ldflags "-X main.version=$(NPM_VERSION) $(LD_BUILD_FLAGS)" -gcflags="-dwarflocationlists=true"
cd $(NPM_DIR) && CGO_ENABLED=0 GOEXPERIMENT=$(ACN_GOEXPERIMENT) go build -v -o $(NPM_BUILD_DIR)/azure-npm$(EXE_EXT) -ldflags "-X main.version=$(NPM_VERSION) -X $(NPM_AI_PATH)=$(NPM_AI_ID) $(LD_BUILD_FLAGS)" -gcflags="-dwarflocationlists=true"

# Build the azure-ip-masq-merger binary.
azure-ip-masq-merger-binary:
cd $(AZURE_IP_MASQ_MERGER_DIR) && CGO_ENABLED=0 go build -v -o $(AZURE_IP_MASQ_MERGER_BUILD_DIR)/azure-ip-masq-merger$(EXE_EXT) -ldflags "-X main.version=$(AZURE_IP_MASQ_MERGER_VERSION) $(LD_BUILD_FLAGS)" -gcflags="-dwarflocationlists=true"
cd $(AZURE_IP_MASQ_MERGER_DIR) && CGO_ENABLED=0 GOEXPERIMENT=$(ACN_GOEXPERIMENT) go build -v -o $(AZURE_IP_MASQ_MERGER_BUILD_DIR)/azure-ip-masq-merger$(EXE_EXT) -ldflags "-X main.version=$(AZURE_IP_MASQ_MERGER_VERSION) $(LD_BUILD_FLAGS)" -gcflags="-dwarflocationlists=true"

# Build the azure-iptables-monitor binary.
azure-iptables-monitor-binary:
cd $(AZURE_IPTABLES_MONITOR_DIR) && CGO_ENABLED=0 go build -v -o $(AZURE_IPTABLES_MONITOR_BUILD_DIR)/azure-iptables-monitor$(EXE_EXT) -ldflags "-X main.version=$(AZURE_IPTABLES_MONITOR_VERSION)" -gcflags="-dwarflocationlists=true"
cd $(AZURE_IPTABLES_MONITOR_DIR) && CGO_ENABLED=0 GOEXPERIMENT=$(ACN_GOEXPERIMENT) go build -v -o $(AZURE_IPTABLES_MONITOR_BUILD_DIR)/azure-iptables-monitor$(EXE_EXT) -ldflags "-X main.version=$(AZURE_IPTABLES_MONITOR_VERSION)" -gcflags="-dwarflocationlists=true"

##@ Containers

Expand Down
5 changes: 3 additions & 2 deletions azure-ip-masq-merger/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
ARG ARCH
ARG OS

# mcr.microsoft.com/oss/go/microsoft/golang:1.24-azurelinux3.0
FROM --platform=linux/${ARCH} mcr.microsoft.com/oss/go/microsoft/golang@sha256:bc7423b52b62e8f0281b5f7f564eb1862dc315bc57e1373c6a81e87ef3ac39ab AS go
# mcr.microsoft.com/oss/go/microsoft/golang:1.26-azurelinux3.0
FROM --platform=linux/${ARCH} mcr.microsoft.com/oss/go/microsoft/golang@sha256:5f95bf70f4c437de4a6ba1f72ef1532f69fca392c131fff2172993cabbea359c AS go

FROM go AS azure-ip-masq-merger
ARG OS
ARG VERSION
ENV GOEXPERIMENT=ms_nocgo_opensslcrypto
WORKDIR /azure-ip-masq-merger
COPY ./azure-ip-masq-merger .
RUN GOOS=$OS CGO_ENABLED=0 go build -a -o /go/bin/ip-masq-merger -trimpath -ldflags "-s -w -X main.version="$VERSION"" -gcflags="-dwarflocationlists=true" .
Comment on lines 10 to 15
Expand Down
1 change: 1 addition & 0 deletions azure-ip-masq-merger/Dockerfile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ FROM --platform=linux/${ARCH} {{.GO_PIN}} AS go
FROM go AS azure-ip-masq-merger
ARG OS
ARG VERSION
ENV GOEXPERIMENT=ms_nocgo_opensslcrypto
WORKDIR /azure-ip-masq-merger
COPY ./azure-ip-masq-merger .
RUN GOOS=$OS CGO_ENABLED=0 go build -a -o /go/bin/ip-masq-merger -trimpath -ldflags "-s -w -X main.version="$VERSION"" -gcflags="-dwarflocationlists=true" .
Comment on lines +12 to 15
Expand Down
8 changes: 5 additions & 3 deletions azure-ipam/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ ARG DROPGZ_VERSION=v0.0.12
ARG OS_VERSION
ARG OS

# mcr.microsoft.com/oss/go/microsoft/golang:1.24-azurelinux3.0
FROM --platform=linux/${ARCH} mcr.microsoft.com/oss/go/microsoft/golang@sha256:bc7423b52b62e8f0281b5f7f564eb1862dc315bc57e1373c6a81e87ef3ac39ab AS go
# mcr.microsoft.com/oss/go/microsoft/golang:1.26-azurelinux3.0
FROM --platform=linux/${ARCH} mcr.microsoft.com/oss/go/microsoft/golang@sha256:5f95bf70f4c437de4a6ba1f72ef1532f69fca392c131fff2172993cabbea359c AS go

# mcr.microsoft.com/azurelinux/base/core:3.0
FROM --platform=linux/${ARCH} mcr.microsoft.com/azurelinux/base/core@sha256:35149ae8dd179684f969944f54a337c665a64e702486154eb44253fb39c2505b AS mariner-core
FROM --platform=linux/${ARCH} mcr.microsoft.com/azurelinux/base/core@sha256:2d83ae6e0d21cd58973633948d903038679f70fb594d6565626f29ddc162fe0c AS mariner-core

FROM go AS azure-ipam
ARG OS
ARG VERSION
ENV GOEXPERIMENT=ms_nocgo_opensslcrypto
WORKDIR /azure-ipam
COPY ./azure-ipam .
RUN GOOS=$OS CGO_ENABLED=0 go build -a -o /go/bin/azure-ipam -trimpath -ldflags "-s -w -X main.version="$VERSION" -X github.com/Azure/azure-container-networking/azure-ipam/internal/buildinfo.Version="$VERSION"" -gcflags="-dwarflocationlists=true" .
Comment on lines 15 to 20
Expand All @@ -30,6 +31,7 @@ FROM go AS dropgz
ARG DROPGZ_VERSION
ARG OS
ARG VERSION
ENV GOEXPERIMENT=ms_nocgo_opensslcrypto
RUN go mod download github.com/azure/azure-container-networking/dropgz@$DROPGZ_VERSION
WORKDIR /go/pkg/mod/github.com/azure/azure-container-networking/dropgz\@$DROPGZ_VERSION
COPY --from=compressor /payload/* pkg/embed/fs/
Comment on lines +34 to 37
Expand Down
2 changes: 2 additions & 0 deletions azure-ipam/Dockerfile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ FROM --platform=linux/${ARCH} {{.MARINER_CORE_PIN}} AS mariner-core
FROM go AS azure-ipam
ARG OS
ARG VERSION
ENV GOEXPERIMENT=ms_nocgo_opensslcrypto
WORKDIR /azure-ipam
COPY ./azure-ipam .
RUN GOOS=$OS CGO_ENABLED=0 go build -a -o /go/bin/azure-ipam -trimpath -ldflags "-s -w -X main.version="$VERSION" -X github.com/Azure/azure-container-networking/azure-ipam/internal/buildinfo.Version="$VERSION"" -gcflags="-dwarflocationlists=true" .
Comment on lines +17 to 20
Expand All @@ -30,6 +31,7 @@ FROM go AS dropgz
ARG DROPGZ_VERSION
ARG OS
ARG VERSION
ENV GOEXPERIMENT=ms_nocgo_opensslcrypto
RUN go mod download github.com/azure/azure-container-networking/dropgz@$DROPGZ_VERSION
WORKDIR /go/pkg/mod/github.com/azure/azure-container-networking/dropgz\@$DROPGZ_VERSION
COPY --from=compressor /payload/* pkg/embed/fs/
Comment on lines +34 to 37
Expand Down
10 changes: 6 additions & 4 deletions azure-iptables-monitor/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@
ARG ARCH

# mcr.microsoft.com/azurelinux/base/core:3.0
FROM mcr.microsoft.com/azurelinux/base/core@sha256:35149ae8dd179684f969944f54a337c665a64e702486154eb44253fb39c2505b AS mariner-core
FROM mcr.microsoft.com/azurelinux/base/core@sha256:2d83ae6e0d21cd58973633948d903038679f70fb594d6565626f29ddc162fe0c AS mariner-core

# mcr.microsoft.com/azurelinux/distroless/base:3.0
FROM mcr.microsoft.com/azurelinux/distroless/base@sha256:32820d2cf20e896aa9111742dd683dd0ccff370f742e256889bb3bb50320c0d4 AS mariner-distroless
FROM mcr.microsoft.com/azurelinux/distroless/base@sha256:60a4f5539feea275365474c3600bba9c426872c5a86f80755acd169618da335e AS mariner-distroless

# mcr.microsoft.com/oss/go/microsoft/golang:1.24-azurelinux3.0
FROM --platform=linux/${ARCH} mcr.microsoft.com/oss/go/microsoft/golang@sha256:bc7423b52b62e8f0281b5f7f564eb1862dc315bc57e1373c6a81e87ef3ac39ab AS go
# mcr.microsoft.com/oss/go/microsoft/golang:1.26-azurelinux3.0
FROM --platform=linux/${ARCH} mcr.microsoft.com/oss/go/microsoft/golang@sha256:5f95bf70f4c437de4a6ba1f72ef1532f69fca392c131fff2172993cabbea359c AS go


FROM go AS azure-iptables-monitor
ARG OS
ARG VERSION
ENV GOEXPERIMENT=ms_nocgo_opensslcrypto
WORKDIR /azure-iptables-monitor
COPY ./azure-iptables-monitor .
RUN GOOS=$OS CGO_ENABLED=0 go build -a -o /go/bin/iptables-monitor -trimpath -ldflags "-s -w -X main.version="$VERSION"" -gcflags="-dwarflocationlists=true" .
Expand All @@ -30,6 +31,7 @@ COPY ./go.mod ./go.sum ./
RUN tdnf install -y llvm clang libbpf-devel gcc binutils glibc
# Set up C include path for BPF
ENV C_INCLUDE_PATH=/usr/include/bpf
ENV GOEXPERIMENT=ms_nocgo_opensslcrypto
# Set up architecture-specific symlinks for cross-compilation support
RUN if [ "$ARCH" = "amd64" ]; then \
ARCH_DIR=x86_64-linux-gnu; \
Expand Down
Loading
Loading