Skip to content

Commit 0fd3374

Browse files
committed
Fix CMake installation process per https://apt.kitware.com/
Related to: cpp-best-practices/gui_starter_template#210
1 parent 267e8cd commit 0fd3374

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Dockerfile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,15 @@ RUN update-alternatives --install /usr/bin/clang clang $(which clang-${LLVM_VER}
6363
RUN update-alternatives --install /usr/bin/clang++ clang++ $(which clang++-${LLVM_VER}) 100
6464

6565
# Add current cmake/ccmake, from Kitware
66-
ARG CMAKE_URL="https://apt.kitware.com/ubuntu/"
67-
ARG CMAKE_PKG=${VARIANT}
66+
ENV KEYRING_FILE="/usr/share/keyrings/kitware-archive-keyring.gpg"
6867
RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null \
69-
| gpg --dearmor - | tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null && \
70-
apt-add-repository -y "deb ${CMAKE_URL} ${CMAKE_PKG} main" && \
71-
apt-get update -qq && export DEBIAN_FRONTEND=noninteractive && \
68+
| gpg --dearmor - | tee "${KEYRING_FILE}" >/dev/null && \
69+
echo 'deb [signed-by=${KEYRING_FILE}] https://apt.kitware.com/ubuntu/ ${VARIANT} main' \
70+
| tee /etc/apt/sources.list.d/kitware.list >/dev/null && \
71+
apt-get update && \
72+
rm "${KEYRING_FILE}" && \
73+
apt-get install kitware-archive-keyring && \
74+
export DEBIAN_FRONTEND=noninteractive && \
7275
apt-get install -y --no-install-recommends cmake cmake-curses-gui
7376

7477
# Install editors

0 commit comments

Comments
 (0)