Skip to content

Commit

Permalink
update kuscia-ci.Dockerfile for supporting multi-arch (#68)
Browse files Browse the repository at this point in the history
* update kuscia-ci.Dockerfile for supporting multi-arch

* update
  • Loading branch information
yushiqie authored Jun 16, 2024
1 parent afcfb35 commit c8bd139
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions dockerfiles/kuscia-ci.DockerFile
Original file line number Diff line number Diff line change
Expand Up @@ -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; \
Expand All @@ -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" ]

0 comments on commit c8bd139

Please sign in to comment.