From c8bd13921cde767a70c1fce8b1724a5e8131be7e Mon Sep 17 00:00:00 2001 From: yushiqie <1539578852@qq.com> Date: Sun, 16 Jun 2024 20:29:25 +0800 Subject: [PATCH] update kuscia-ci.Dockerfile for supporting multi-arch (#68) * update kuscia-ci.Dockerfile for supporting multi-arch * update --- dockerfiles/kuscia-ci.DockerFile | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/dockerfiles/kuscia-ci.DockerFile b/dockerfiles/kuscia-ci.DockerFile index 3b4e657..3bf66e6 100644 --- a/dockerfiles/kuscia-ci.DockerFile +++ b/dockerfiles/kuscia-ci.DockerFile @@ -9,17 +9,24 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone # change dash to bash as default shell RUN ln -sf /usr/bin/bash /bin/sh +ARG TARGETPLATFORM +ARG TARGETARCH ARG GO_VERSION=1.19.7 -ARG GO_SHA256SUM="7a75720c9b066ae1750f6bcc7052aba70fa3813f4223199ee2a2315fd3eb533d" RUN apt-get update \ && apt-get upgrade -y \ - && apt-get install -y git wget unzip gcc make \ + && apt-get install -y git wget unzip gcc make curl \ && apt-get clean # install go RUN set -eux; \ - url="https://golang.google.cn/dl/go${GO_VERSION}.linux-amd64.tar.gz"; \ + if [ "$TARGETPLATFORM" = "linux/arm64" ] ; \ + then \ + GO_SHA256SUM=071ea7bf386fdd08df524859b878d99fc359e491e7ad65c1c1cc55b67972c882 ; \ + else \ + GO_SHA256SUM=7a75720c9b066ae1750f6bcc7052aba70fa3813f4223199ee2a2315fd3eb533d ; \ + fi \ + && url="https://golang.google.cn/dl/go${GO_VERSION}.linux-${TARGETARCH}.tar.gz"; \ wget --no-check-certificate -O go.tgz "$url"; \ echo "${GO_SHA256SUM} *go.tgz" | sha256sum -c -; \ tar -C /usr/local -xzf go.tgz; \ @@ -36,4 +43,4 @@ RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28.1 && \ # run as root for now WORKDIR /home/admin/ -ENTRYPOINT [ "/bin/bash", "-l" ] +ENTRYPOINT [ "/bin/bash", "-l" ] \ No newline at end of file