@@ -82,19 +82,25 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
8282 openssh-client \
8383 lsb-release software-properties-common gnupg sudo \
8484 python3-colorama python3-dpkt && \
85- wget -O ./llvm-snapshot.gpg.key https://apt.llvm.org/llvm-snapshot.gpg.key && \
86- apt-key add ./llvm-snapshot.gpg.key && \
87- rm ./llvm-snapshot.gpg.key && \
88- echo "deb https://apt.llvm.org/noble/ llvm-toolchain-noble main" > /etc/apt/sources.list.d/llvm-apt.list && \
89- apt-get update && \
90- version=`apt-cache search clangd- | grep clangd- | awk -F' ' '{print $1}' | sort -V | tail -1 | cut -d- -f2` && \
91- apt-get install -y --no-install-recommends clangd-$version && \
9285 update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 50 && \
9386 update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 50 && \
94- update-alternatives --install /usr/bin/clangd clangd /usr/bin/clangd-$version 50 && \
9587 apt-get autoremove -y && apt-get clean && \
9688 rm -rf /var/lib/apt/lists/* /tmp/*
9789
90+ # Install latest stable llvm-toolchain
91+ RUN mkdir -p /etc/apt/keyrings && \
92+ wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | gpg -o /etc/apt/keyrings/llvm-snapshot.gpg --dearmor && \
93+ echo "deb [signed-by=/etc/apt/keyrings/llvm-snapshot.gpg] https://mirrors.tuna.tsinghua.edu.cn/llvm-apt/noble/ llvm-toolchain-noble-22 main" \
94+ | tee /etc/apt/sources.list.d/llvm.list && \
95+ apt-get update && \
96+ apt-get install -y --no-install-recommends clang-22 clangd-22 clang-format-22 lldb-22 && \
97+ update-alternatives --install /usr/bin/clang clang /usr/bin/clang-22 100 && \
98+ update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-22 100 && \
99+ update-alternatives --install /usr/bin/clangd clangd /usr/bin/clangd-22 100 && \
100+ update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-22 100 && \
101+ update-alternatives --install /usr/bin/lldb lldb /usr/bin/lldb-22 100 && \
102+ apt-get autoremove -y && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/*
103+
98104# Generate/load ssh key and setup unison
99105RUN --mount=type=bind,target=/tmp/.ssh,source=.ssh,readonly=false \
100106 cd /home/ubuntu && mkdir -p .ssh && \
@@ -111,6 +117,11 @@ RUN curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linu
111117 tar -C /opt -xzf nvim-linux-x86_64.tar.gz && \
112118 rm nvim-linux-x86_64.tar.gz
113119
120+ # Install latest stable cmake for user ubuntu
121+ RUN wget https://github.com/kitware/cmake/releases/download/v4.2.3/cmake-4.2.3-linux-x86_64.sh -O install.sh && \
122+ mkdir -p /opt/cmake/ && bash install.sh --skip-license --prefix=/opt/cmake/ --exclude-subdir && \
123+ rm install.sh
124+
114125# Change user
115126RUN chsh -s /bin/zsh ubuntu && \
116127 echo "ubuntu ALL=(ALL:ALL) NOPASSWD:ALL" >> /etc/sudoers
@@ -124,12 +135,14 @@ RUN sh -c "$(wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools
124135 sed -i 's/ZSH_THEME=\" [a-z0-9\- ]*\" /ZSH_THEME="af-magic"/g' ~/.zshrc && \
125136 echo 'source ~/env_setup.zsh' >> ~/.zshrc && \
126137 echo 'export PATH="${PATH}:/opt/nvim-linux-x86_64/bin"' >> ~/.zshrc && \
138+ # echo 'export PATH="${PATH}:/opt/cmake/bin"' >> ~/.zshrc && \
127139 echo 'export PATH="${PATH}:${RMCS_PATH}/.script"' >> ~/.zshrc
128140
129141# Copy environment setup scripts
130142COPY --chown=1000:1000 .script/template/env_setup.bash env_setup.bash
131143COPY --chown=1000:1000 .script/template/env_setup.zsh env_setup.zsh
132144
145+
133146# Runtime container, will automatically launch the main program
134147FROM rmcs-base AS rmcs-runtime
135148
0 commit comments