Skip to content

Commit ff31154

Browse files
changes docker
1 parent 52d27ca commit ff31154

File tree

4 files changed

+68
-9
lines changed

4 files changed

+68
-9
lines changed

Dockerfolder/CUDA-12.9.1-Ubuntu-20.04.Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ RUN apt-get install curl -y
77
ARG REINSTALL_CMAKE_VERSION_FROM_SOURCE="3.27.9"
88

99
# Optionally install the cmake for vcpkg
10-
COPY scripts/packages-install/reinstall-cmake.sh /tmp/
10+
COPY scripts/packages-install/reinstall-cmake-ubuntu.sh /tmp/
1111

1212
RUN if [ "${REINSTALL_CMAKE_VERSION_FROM_SOURCE}" != "none" ]; then \
13-
chmod +x /tmp/reinstall-cmake.sh && /tmp/reinstall-cmake.sh ${REINSTALL_CMAKE_VERSION_FROM_SOURCE}; \
13+
chmod +x /tmp/reinstall-cmake.sh && /tmp/reinstall-cmake-ubuntu.sh ${REINSTALL_CMAKE_VERSION_FROM_SOURCE}; \
1414
fi \
15-
&& rm -f /tmp/reinstall-cmake.sh
15+
&& rm -f /tmp/reinstall-cmake-ubuntu.sh
1616

1717

1818
# [Optional] Uncomment this section to install additional vcpkg ports.

Dockerfolder/CUDA-12.9.1-ubi8.Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
FROM nvcr.io/nvidia/cuda:12.9.1-devel-ubi8
22

3-
RUN apt-get update
4-
RUN apt-get upgrade -y
5-
RUN apt-get install curl -y
3+
RUN dnf update
4+
RUN dnf upgrade -y
5+
RUN dnf install curl -y
66

77
ARG REINSTALL_CMAKE_VERSION_FROM_SOURCE="3.27.9"
88

99
# Optionally install the cmake for vcpkg
10-
COPY scripts/packages-install/reinstall-cmake.sh /tmp/
10+
COPY scripts/packages-install/reinstall-cmake-rhel.sh /tmp/
1111

1212
RUN if [ "${REINSTALL_CMAKE_VERSION_FROM_SOURCE}" != "none" ]; then \
13-
chmod +x /tmp/reinstall-cmake.sh && /tmp/reinstall-cmake.sh ${REINSTALL_CMAKE_VERSION_FROM_SOURCE}; \
13+
chmod +x /tmp/reinstall-cmake.sh && /tmp/reinstall-cmake-rhel.sh ${REINSTALL_CMAKE_VERSION_FROM_SOURCE}; \
1414
fi \
15-
&& rm -f /tmp/reinstall-cmake.sh
15+
&& rm -f /tmp/reinstall-cmake-rhel.sh
1616

1717

1818
# [Optional] Uncomment this section to install additional vcpkg ports.
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#!/usr/bin/env bash
2+
#-------------------------------------------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
5+
#-------------------------------------------------------------------------------------------------------------
6+
#
7+
set -e
8+
9+
CMAKE_VERSION=${1:-"none"}
10+
11+
if [ "${CMAKE_VERSION}" = "none" ]; then
12+
echo "No CMake version specified, skipping CMake reinstallation"
13+
exit 0
14+
fi
15+
16+
# Cleanup temporary directory and associated files when exiting the script.
17+
cleanup() {
18+
EXIT_CODE=$?
19+
set +e
20+
if [[ -n "${TMP_DIR}" ]]; then
21+
echo "Executing cleanup of tmp files"
22+
rm -Rf "${TMP_DIR}"
23+
fi
24+
exit $EXIT_CODE
25+
}
26+
trap cleanup EXIT
27+
28+
29+
echo "Installing CMake..."
30+
dnf -y autoremove cmake
31+
mkdir -p /opt/cmake
32+
33+
architecture=$(dpkg --print-architecture)
34+
case "${architecture}" in
35+
arm64)
36+
ARCH=aarch64 ;;
37+
amd64)
38+
ARCH=x86_64 ;;
39+
*)
40+
echo "Unsupported architecture ${architecture}."
41+
exit 1
42+
;;
43+
esac
44+
45+
CMAKE_BINARY_NAME="cmake-${CMAKE_VERSION}-linux-${ARCH}.sh"
46+
CMAKE_CHECKSUM_NAME="cmake-${CMAKE_VERSION}-SHA-256.txt"
47+
TMP_DIR=$(mktemp -d -t cmake-XXXXXXXXXX)
48+
49+
echo "${TMP_DIR}"
50+
cd "${TMP_DIR}"
51+
52+
curl -sSL "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/${CMAKE_BINARY_NAME}" -O
53+
curl -sSL "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/${CMAKE_CHECKSUM_NAME}" -O
54+
55+
sha256sum -c --ignore-missing "${CMAKE_CHECKSUM_NAME}"
56+
sh "${TMP_DIR}/${CMAKE_BINARY_NAME}" --prefix=/opt/cmake --skip-license
57+
58+
ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake
59+
ln -s /opt/cmake/bin/ctest /usr/local/bin/ctest

0 commit comments

Comments
 (0)