diff --git a/build/Makefile b/build/Makefile index ae0d3c7663..9b38017385 100644 --- a/build/Makefile +++ b/build/Makefile @@ -218,12 +218,6 @@ ifdef LOCAL_ZIP ZIP_SDK=cd $(agones_path)/cmd/sdk-server/bin && zip -0 endif -unameprocessor := $(shell uname -p) -ifeq ($(unameprocessor),arm) - DOCKER_BUILD_ARGS += --platform linux/x86_64 - DOCKER_RUN_ARGS += --platform linux/x86_64 -endif - # ___ ____ ___ _ _ # / _ \/ ___| |_ _|_ __ ___| |_ _ __| | ___ # | | | \___ \ | || '_ \ / __| | | | |/ _` |/ _ \ @@ -557,14 +551,14 @@ build-controller-image: build-controller-image-arm64 endif build-controller-image-amd64: $(ensure-build-image) build-controller-binary build-licenses build-required-src-dist - docker build $(agones_path)/cmd/controller/ --tag=$(controller_amd64_tag) $(DOCKER_BUILD_ARGS) + docker build --platform linux/amd64 $(agones_path)/cmd/controller/ --tag=$(controller_amd64_tag) $(DOCKER_BUILD_ARGS) # creating docker builder and then using that builder to build controller image in buildx command build-controller-image-arm64: $(ensure-build-image) build-controller-binary create-arm64-builder docker buildx build --platform linux/arm64 --builder $(BUILDX_ARM64_BUILDER) --build-arg ARCH=arm64 $(agones_path)/cmd/controller/ --tag=$(controller_arm64_tag) $(DOCKER_BUILD_ARGS) # Build the debug image for the controller service build-controller-debug-image: $(ensure-build-image) build-controller-debug-binary build-licenses build-required-src-dist - docker build $(agones_path)/cmd/controller/ --file $(agones_path)/cmd/controller/Dockerfile.debug --tag=$(controller_amd64_tag) $(DOCKER_BUILD_ARGS) + docker build --platform linux/amd64 $(agones_path)/cmd/controller/ --file $(agones_path)/cmd/controller/Dockerfile.debug --tag=$(controller_amd64_tag) $(DOCKER_BUILD_ARGS) # push the gameservers controller image push-controller-image: push-controller-image-amd64 @@ -620,14 +614,14 @@ build-extensions-image: build-extensions-image-arm64 endif build-extensions-image-amd64: $(ensure-build-image) build-extensions-binary build-licenses build-required-src-dist - docker build $(agones_path)/cmd/extensions/ --tag=$(extensions_amd64_tag) $(DOCKER_BUILD_ARGS) + docker build --platform linux/amd64 $(agones_path)/cmd/extensions/ --tag=$(extensions_amd64_tag) $(DOCKER_BUILD_ARGS) # creating docker builder and then using that builder to build extensions image in buildx command build-extensions-image-arm64: $(ensure-build-image) build-extensions-binary create-arm64-builder docker buildx build --provenance false --platform linux/arm64 --builder $(BUILDX_ARM64_BUILDER) --build-arg ARCH=arm64 $(agones_path)/cmd/extensions/ --tag=$(extensions_arm64_tag) $(DOCKER_BUILD_ARGS) # Build the debug image for the extensions service build-extensions-debug-image: $(ensure-build-image) build-extensions-debug-binary build-licenses build-required-src-dist - docker build $(agones_path)/cmd/extensions/ --file $(agones_path)/cmd/extensions/Dockerfile.debug --tag=$(extensions_amd64_tag) $(DOCKER_BUILD_ARGS) + docker build --platform linux/amd64 $(agones_path)/cmd/extensions/ --file $(agones_path)/cmd/extensions/Dockerfile.debug --tag=$(extensions_amd64_tag) $(DOCKER_BUILD_ARGS) # push the gameservers extensions image push-extensions-image: push-extensions-image-amd64 @@ -653,7 +647,7 @@ build-agones-sdk-image: build-agones-sdk-image-windows endif build-agones-sdk-image-amd64: $(ensure-build-image) build-agones-sdk-binary-linux-amd64 - docker build $(agones_path)/cmd/sdk-server/ --tag=$(sidecar_linux_amd64_tag) $(DOCKER_BUILD_ARGS) + docker build --platform linux/amd64 $(agones_path)/cmd/sdk-server/ --tag=$(sidecar_linux_amd64_tag) $(DOCKER_BUILD_ARGS) # creating docker builder and then using that builder to build sdk image in buildx command build-agones-sdk-image-arm64: $(ensure-build-image) build-agones-sdk-binary-linux-arm64 create-arm64-builder docker buildx build --provenance false --platform linux/arm64 --builder $(BUILDX_ARM64_BUILDER) --build-arg ARCH=arm64 $(agones_path)/cmd/sdk-server/ --tag=$(sidecar_linux_arm64_tag) $(DOCKER_BUILD_ARGS) @@ -667,7 +661,7 @@ build-agones-sdk-image-windows-%: $(ensure-build-image) build-agones-sdk-binary # Build the debug image for the agones-sdk service build-agones-sdk-debug-image: $(ensure-build-image) build-agones-sdk-debug-binary build-licenses build-required-src-dist - docker build $(agones_path)/cmd/sdk-server/ --file $(agones_path)/cmd/sdk-server/Dockerfile.debug --tag=$(sidecar_linux_amd64_tag) $(DOCKER_BUILD_ARGS) + docker build --platform linux/amd64 $(agones_path)/cmd/sdk-server/ --file $(agones_path)/cmd/sdk-server/Dockerfile.debug --tag=$(sidecar_linux_amd64_tag) $(DOCKER_BUILD_ARGS) # Build a static binary for the ping service build-ping-binary: build-ping-binary-amd64 @@ -709,14 +703,14 @@ build-ping-image: build-ping-image-arm64 endif build-ping-image-amd64: $(ensure-build-image) build-ping-binary build-licenses build-required-src-dist - docker build $(agones_path)/cmd/ping/ --tag=$(ping_amd64_tag) $(DOCKER_BUILD_ARGS) + docker build --platform linux/amd64 $(agones_path)/cmd/ping/ --tag=$(ping_amd64_tag) $(DOCKER_BUILD_ARGS) # creating docker builder and then using that builder to build ping image in buildx command build-ping-image-arm64: $(ensure-build-image) build-ping-binary create-arm64-builder docker buildx build --provenance false --platform linux/arm64 --builder $(BUILDX_ARM64_BUILDER) --build-arg ARCH=arm64 $(agones_path)/cmd/ping/ --tag=$(ping_arm64_tag) $(DOCKER_BUILD_ARGS) # Build the debug image for the ping service build-ping-debug-image: $(ensure-build-image) build-ping-debug-binary build-licenses build-required-src-dist - docker build $(agones_path)/cmd/ping/ --file $(agones_path)/cmd/ping/Dockerfile.debug --tag=$(ping_amd64_tag) $(DOCKER_BUILD_ARGS) + docker build --platform linux/amd64 $(agones_path)/cmd/ping/ --file $(agones_path)/cmd/ping/Dockerfile.debug --tag=$(ping_amd64_tag) $(DOCKER_BUILD_ARGS) # Build a static binary for the allocator service build-allocator-binary: $(ensure-build-image) build-allocator-binary-linux-amd64 @@ -757,14 +751,14 @@ build-allocator-image: build-allocator-image-arm64 endif build-allocator-image-amd64: $(ensure-build-image) build-allocator-binary build-licenses build-required-src-dist - docker build $(agones_path)/cmd/allocator/ --tag=$(allocator_amd64_tag) $(DOCKER_BUILD_ARGS) + docker build --platform linux/amd64 $(agones_path)/cmd/allocator/ --tag=$(allocator_amd64_tag) $(DOCKER_BUILD_ARGS) # creating docker builder and then using that builder to build allocator image in buildx command build-allocator-image-arm64: $(ensure-build-image) build-allocator-binary create-arm64-builder docker buildx build --provenance false $(agones_path)/cmd/allocator/ --builder $(BUILDX_ARM64_BUILDER) --tag=$(allocator_arm64_tag) --build-arg ARCH=arm64 --platform linux/arm64 $(DOCKER_BUILD_ARGS) # Build the debug image for the allocator service build-allocator-debug-image: $(ensure-build-image) build-allocator-debug-binary build-licenses build-required-src-dist - docker build $(agones_path)/cmd/allocator/ --file $(agones_path)/cmd/allocator/Dockerfile.debug --tag=$(allocator_amd64_tag) $(DOCKER_BUILD_ARGS) + docker build --platform linux/amd64 $(agones_path)/cmd/allocator/ --file $(agones_path)/cmd/allocator/Dockerfile.debug --tag=$(allocator_amd64_tag) $(DOCKER_BUILD_ARGS) # push the processor image build-processor-binary: $(ensure-build-image) build-processor-binary-linux-amd64 @@ -792,14 +786,14 @@ build-processor-image: build-processor-image-arm64 endif build-processor-image-amd64: $(ensure-build-image) build-processor-binary build-licenses build-required-src-dist - docker build $(agones_path)/cmd/processor/ --tag=$(processor_amd64_tag) $(DOCKER_BUILD_ARGS) + docker build --platform linux/amd64 $(agones_path)/cmd/processor/ --tag=$(processor_amd64_tag) $(DOCKER_BUILD_ARGS) # creating docker builder and then using that builder to build processor image in buildx command build-processor-image-arm64: $(ensure-build-image) build-processor-binary create-arm64-builder docker buildx build --provenance false --platform linux/arm64 --builder $(BUILDX_ARM64_BUILDER) --build-arg ARCH=arm64 $(agones_path)/cmd/processor/ --tag=$(processor_arm64_tag) $(DOCKER_BUILD_ARGS) # Build the debug image for the processor service build-processor-debug-image: $(ensure-build-image) build-processor-debug-binary build-licenses build-required-src-dist - docker build $(agones_path)/cmd/processor/ --file $(agones_path)/cmd/processor/Dockerfile.debug --tag=$(processor_amd64_tag) $(DOCKER_BUILD_ARGS) + docker build --platform linux/amd64 $(agones_path)/cmd/processor/ --file $(agones_path)/cmd/processor/Dockerfile.debug --tag=$(processor_amd64_tag) $(DOCKER_BUILD_ARGS) # Pushes up the processor image push-processor-image: push-processor-image-amd64 diff --git a/build/build-image/Dockerfile b/build/build-image/Dockerfile index b9eabcd31a..24c5877d4e 100644 --- a/build/build-image/Dockerfile +++ b/build/build-image/Dockerfile @@ -31,8 +31,9 @@ WORKDIR /usr/local ENV GO_VERSION=1.26.0 ENV GOPATH=/go ENV GO111MODULE=on -RUN wget -q https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz && \ - tar -xzf go${GO_VERSION}.linux-amd64.tar.gz && rm go${GO_VERSION}.linux-amd64.tar.gz && mkdir ${GOPATH} +RUN ARCH=$(dpkg --print-architecture) && \ + wget -q https://dl.google.com/go/go${GO_VERSION}.linux-${ARCH}.tar.gz && \ + tar -xzf go${GO_VERSION}.linux-${ARCH}.tar.gz && rm go${GO_VERSION}.linux-${ARCH}.tar.gz && mkdir ${GOPATH} # install gcloud + kubectl, because it's an easy way to test/dev against kubernetes. WORKDIR /opt @@ -55,7 +56,8 @@ RUN go install golang.org/x/tools/cmd/goimports@latest && \ ENV KUBERNETES_VER=1.34.6 # overwrite kubectl as we want a specific version -RUN curl -LO https://dl.k8s.io/release/v${KUBERNETES_VER}/bin/linux/amd64/kubectl && \ +RUN ARCH=$(dpkg --print-architecture) && \ + curl -LO https://dl.k8s.io/release/v${KUBERNETES_VER}/bin/linux/${ARCH}/kubectl && \ chmod go+rx ./kubectl && \ mv ./kubectl /usr/local/bin/kubectl RUN echo "source <(kubectl completion bash)" >> /root/.bashrc @@ -66,16 +68,17 @@ RUN mkdir -p /go/src/k8s.io && cd /go/src/k8s.io && \ # install Helm package manager ENV HELM_VER=3.18.4 -ENV HELM_URL=https://get.helm.sh/helm-v${HELM_VER}-linux-amd64.tar.gz -RUN curl -L ${HELM_URL} > /tmp/helm.tar.gz \ +RUN ARCH=$(dpkg --print-architecture) && \ + curl -L https://get.helm.sh/helm-v${HELM_VER}-linux-${ARCH}.tar.gz > /tmp/helm.tar.gz \ && tar -zxvf /tmp/helm.tar.gz -C /tmp \ - && mv /tmp/linux-amd64/helm /usr/local/bin/helm \ + && mv /tmp/linux-${ARCH}/helm /usr/local/bin/helm \ && chmod go+rx /usr/local/bin/helm \ - && rm /tmp/helm.tar.gz && rm -rf /tmp/linux-amd64 + && rm /tmp/helm.tar.gz && rm -rf /tmp/linux-${ARCH} RUN echo "source <(helm completion bash)" >> /root/.bashrc # install golang-ci linter -RUN go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.64.8 +# CGO disabled to avoid the linker depending on gold (deprecated in debian:trixie) +RUN CGO_ENABLED=0 go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.64.8 # Install yamllint RUN apt-get update && \ @@ -97,8 +100,9 @@ RUN curl -s https://get.extism.org/cli | sh -s -- -v v1.6.2 -y && \ # ENV HUGO_VER=0.152.2 -RUN mkdir /tmp/hugo && \ - wget -q -O /tmp/hugo/hugo.tar.gz https://github.com/gohugoio/hugo/releases/download/v${HUGO_VER}/hugo_extended_${HUGO_VER}_Linux-64bit.tar.gz && \ +RUN ARCH=$(dpkg --print-architecture) && \ + mkdir /tmp/hugo && \ + wget -q -O /tmp/hugo/hugo.tar.gz https://github.com/gohugoio/hugo/releases/download/v${HUGO_VER}/hugo_extended_${HUGO_VER}_linux-${ARCH}.tar.gz && \ tar -zxvf /tmp/hugo/hugo.tar.gz -C /tmp/hugo/ && \ mv /tmp/hugo/hugo /usr/local/bin/ && \ rm -r /tmp/hugo @@ -122,8 +126,9 @@ RUN mkdir -p /go/src/github.com/ahmetb && \ cd ./gen-crd-api-reference-docs && go build # html checker -RUN mkdir /tmp/htmltest && \ - wget -O /tmp/htmltest/htmltest.tar.gz https://github.com/wjdp/htmltest/releases/download/v0.17.0/htmltest_0.17.0_linux_amd64.tar.gz && \ +RUN ARCH=$(dpkg --print-architecture) && \ + mkdir /tmp/htmltest && \ + wget -O /tmp/htmltest/htmltest.tar.gz https://github.com/wjdp/htmltest/releases/download/v0.17.0/htmltest_0.17.0_linux_${ARCH}.tar.gz && \ tar -zxvf /tmp/htmltest/htmltest.tar.gz -C /tmp/htmltest && \ mv /tmp/htmltest/htmltest /usr/local/bin && \ rm -r /tmp/htmltest @@ -134,7 +139,9 @@ RUN echo "export PATH=/usr/local/go/bin:/go/bin/:\$PATH" >> /root/.bashrc RUN echo "export EDITOR=nano" >> /root/.bashrc # install terraform -RUN wget -nv -O terraform.zip https://releases.hashicorp.com/terraform/1.5.4/terraform_1.5.4_linux_amd64.zip && unzip ./terraform.zip && mv terraform /usr/local/bin/ +RUN ARCH=$(dpkg --print-architecture) && \ + wget -nv -O terraform.zip https://releases.hashicorp.com/terraform/1.5.4/terraform_1.5.4_linux_${ARCH}.zip && \ + unzip ./terraform.zip && mv terraform /usr/local/bin/ # code generation scripts COPY *.sh /root/ diff --git a/build/build-sdk-images/go/Dockerfile b/build/build-sdk-images/go/Dockerfile index 6d4936846d..9573743e8c 100644 --- a/build/build-sdk-images/go/Dockerfile +++ b/build/build-sdk-images/go/Dockerfile @@ -23,8 +23,9 @@ WORKDIR /usr/local ENV GO_VERSION=1.26.0 ENV GO111MODULE=on ENV GOPATH /go -RUN wget -q https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz && \ - tar -xzf go${GO_VERSION}.linux-amd64.tar.gz && rm go${GO_VERSION}.linux-amd64.tar.gz && mkdir -p ${GOPATH} +RUN ARCH=$(dpkg --print-architecture) && \ + wget -q https://dl.google.com/go/go${GO_VERSION}.linux-${ARCH}.tar.gz && \ + tar -xzf go${GO_VERSION}.linux-${ARCH}.tar.gz && rm go${GO_VERSION}.linux-${ARCH}.tar.gz && mkdir -p ${GOPATH} ENV PATH /usr/local/go/bin:/go/bin:$PATH diff --git a/build/build-sdk-images/restapi/Dockerfile b/build/build-sdk-images/restapi/Dockerfile index 042b82a447..492eb3adef 100644 --- a/build/build-sdk-images/restapi/Dockerfile +++ b/build/build-sdk-images/restapi/Dockerfile @@ -23,8 +23,9 @@ WORKDIR /usr/local ENV GO_VERSION=1.26.0 ENV GO111MODULE=on ENV GOPATH /go -RUN wget -q https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz && \ - tar -xzf go${GO_VERSION}.linux-amd64.tar.gz && rm go${GO_VERSION}.linux-amd64.tar.gz && mkdir -p ${GOPATH} +RUN ARCH=$(dpkg --print-architecture) && \ + wget -q https://dl.google.com/go/go${GO_VERSION}.linux-${ARCH}.tar.gz && \ + tar -xzf go${GO_VERSION}.linux-${ARCH}.tar.gz && rm go${GO_VERSION}.linux-${ARCH}.tar.gz && mkdir -p ${GOPATH} RUN echo 'ยง' && apt-get -qy update diff --git a/build/build-sdk-images/rust/Dockerfile b/build/build-sdk-images/rust/Dockerfile index 2273deeb19..1852df2b96 100644 --- a/build/build-sdk-images/rust/Dockerfile +++ b/build/build-sdk-images/rust/Dockerfile @@ -23,7 +23,13 @@ ENV RUSTUP_HOME=/usr/local/rustup \ CARGO_HOME=/usr/local/cargo \ PATH=/usr/local/cargo/bin:$PATH \ RUST_VERSION=1.90.0 -RUN wget -q https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-gnu/rustup-init && \ +RUN ARCH=$(dpkg --print-architecture) && \ + case "${ARCH}" in \ + amd64) RUSTUP_ARCH=x86_64-unknown-linux-gnu ;; \ + arm64) RUSTUP_ARCH=aarch64-unknown-linux-gnu ;; \ + *) echo "Unsupported architecture: ${ARCH}" && exit 1 ;; \ + esac && \ + wget -q https://static.rust-lang.org/rustup/dist/${RUSTUP_ARCH}/rustup-init && \ chmod +x rustup-init && \ ./rustup-init -y --no-modify-path --default-toolchain $RUST_VERSION && \ rm rustup-init && \ diff --git a/build/e2e-image/Dockerfile b/build/e2e-image/Dockerfile index a2b917fce2..1d32c0d90c 100644 --- a/build/e2e-image/Dockerfile +++ b/build/e2e-image/Dockerfile @@ -16,25 +16,27 @@ WORKDIR /usr/local ENV GO_VERSION=1.26.0 ENV GOPATH /go ENV GO111MODULE=on -RUN wget -q https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz && \ - tar -xzf go${GO_VERSION}.linux-amd64.tar.gz && rm go${GO_VERSION}.linux-amd64.tar.gz && mkdir ${GOPATH} +RUN ARCH=$(dpkg --print-architecture) && \ + wget -q https://dl.google.com/go/go${GO_VERSION}.linux-${ARCH}.tar.gz && \ + tar -xzf go${GO_VERSION}.linux-${ARCH}.tar.gz && rm go${GO_VERSION}.linux-${ARCH}.tar.gz && mkdir ${GOPATH} ENV PATH /usr/local/go/bin:/go/bin:$PATH # install kubectl without gcloud as we want the last version ENV KUBECTL_VER 1.34.6 -RUN curl -LO https://dl.k8s.io/release/v${KUBECTL_VER}/bin/linux/amd64/kubectl && \ +RUN ARCH=$(dpkg --print-architecture) && \ + curl -LO https://dl.k8s.io/release/v${KUBECTL_VER}/bin/linux/${ARCH}/kubectl && \ chmod go+rx ./kubectl && \ mv ./kubectl /usr/local/bin/kubectl # install Helm package manager ENV HELM_VER 3.18.4 -ENV HELM_URL https://get.helm.sh/helm-v${HELM_VER}-linux-amd64.tar.gz -RUN curl -L ${HELM_URL} > /tmp/helm.tar.gz \ +RUN ARCH=$(dpkg --print-architecture) && \ + curl -L https://get.helm.sh/helm-v${HELM_VER}-linux-${ARCH}.tar.gz > /tmp/helm.tar.gz \ && tar -zxvf /tmp/helm.tar.gz -C /tmp \ - && mv /tmp/linux-amd64/helm /usr/local/bin/helm \ + && mv /tmp/linux-${ARCH}/helm /usr/local/bin/helm \ && chmod go+rx /usr/local/bin/helm \ - && rm /tmp/helm.tar.gz && rm -rf /tmp/linux-amd64 + && rm /tmp/helm.tar.gz && rm -rf /tmp/linux-${ARCH} # install gotestsum test runner RUN go install gotest.tools/gotestsum@latest