diff --git a/Makefile b/Makefile index c1aae97..a250ade 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,12 @@ export docker_image_version := $(project_version) export jupyter_image := openspacecollective/open-space-toolkit-astrodynamics-jupyter:latest export jupyter_port := 8888 + +# Handle multi-platform builds locally (CI sets these env vars, but need defaults here) +TARGETPLATFORM ?= linux/amd64 +$(info Target platform is $(TARGETPLATFORM)) + + build-image: ## Build image docker build \ diff --git a/docker/development/Dockerfile b/docker/development/Dockerfile index 1cee827..fcb63d2 100644 --- a/docker/development/Dockerfile +++ b/docker/development/Dockerfile @@ -109,19 +109,19 @@ RUN python3.9 -m pip install --upgrade pip ipython setuptools build wheel twine ## CMake +ARG TARGETPLATFORM ARG CMAKE_MAJOR_VERSION="3" ARG CMAKE_MINOR_VERSION="26" ARG CMAKE_PATCH_VERSION="3" ARG CMAKE_VERSION="${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" -RUN cd /tmp \ - && wget --quiet https://cmake.org/files/v${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}/cmake-${CMAKE_VERSION}.tar.gz \ - && tar -xf cmake-${CMAKE_VERSION}.tar.gz \ - && cd cmake-${CMAKE_VERSION} \ - && ./bootstrap \ - && make -j $(nproc) \ - && make install \ - && rm -rf /tmp/cmake-${CMAKE_VERSION} /tmp/cmake-${CMAKE_VERSION}.tar.gz +RUN mkdir -p /tmp/cmake \ + && cd /tmp/cmake \ + && export PACKAGE_PLATFORM=$(if [ ${TARGETPLATFORM} = "linux/amd64" ]; then echo "x86_64"; elif [ ${TARGETPLATFORM} = "linux/arm64" ]; then echo "aarch64"; else echo "Unknown platform" && exit 1; fi;) \ + && wget --quiet https://cmake.org/files/v${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}/cmake-${CMAKE_VERSION}-linux-${PACKAGE_PLATFORM}.sh -O cmake-install.sh \ + && chmod +x /tmp/cmake/cmake-install.sh \ + && /tmp/cmake/cmake-install.sh --prefix=/usr/local --skip-license \ + && rm -rf /tmp/cmake ## GoogleTest