mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-22 06:10:22 +00:00
build: check if installed Golang has a compatible architecture
For building a arm64 container image on amd64, it is needed to configure the system specifically for that. In order to prevent including a amd64 executable in a arm64 image, a check has been added. When running an arm64 executable on a amd64 system, an error should occur when cross architecture containers are not supported. This can be triggered when running `make image-cephcsi GO_ARCH=arm64` on a amd64 system. Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
parent
44bf398c79
commit
2055d79165
@ -19,6 +19,9 @@ RUN source /build.env && \
|
||||
mkdir -p ${GOROOT} && \
|
||||
curl https://storage.googleapis.com/golang/go${GOLANG_VERSION}.linux-${GO_ARCH}.tar.gz | tar xzf - -C ${GOROOT} --strip-components=1
|
||||
|
||||
# test if the downloaded version of Golang works (different arch?)
|
||||
RUN ${GOROOT}/bin/go version && ${GOROOT}/bin/go env
|
||||
|
||||
RUN dnf install libcephfs-devel librados-devel librbd-devel /usr/bin/cc make -y
|
||||
|
||||
ENV GOROOT=${GOROOT} \
|
||||
|
Loading…
Reference in New Issue
Block a user