Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 21 additions & 8 deletions Dockerfile
Original file line numberDiff line numberDiff line change
Expand Up@@ -82,19 +82,25 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
openssh-client \
lsb-release software-properties-common gnupg sudo \
python3-colorama python3-dpkt && \
wget -O ./llvm-snapshot.gpg.key https://apt.llvm.org/llvm-snapshot.gpg.key && \
apt-key add ./llvm-snapshot.gpg.key && \
rm ./llvm-snapshot.gpg.key && \
echo "deb https://apt.llvm.org/noble/ llvm-toolchain-noble main" > /etc/apt/sources.list.d/llvm-apt.list && \
apt-get update && \
version=`apt-cache search clangd- | grep clangd- | awk -F' ' '{print $1}' | sort -V | tail -1 | cut -d- -f2` && \
apt-get install -y --no-install-recommends clangd-$version && \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 50 && \
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 50 && \
update-alternatives --install /usr/bin/clangd clangd /usr/bin/clangd-$version 50 && \
apt-get autoremove -y && apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/*

# Install latest stable llvm-toolchain
RUN mkdir -p /etc/apt/keyrings && \
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | gpg -o /etc/apt/keyrings/llvm-snapshot.gpg --dearmor && \
echo "deb [signed-by=/etc/apt/keyrings/llvm-snapshot.gpg] https://mirrors.tuna.tsinghua.edu.cn/llvm-apt/noble/ llvm-toolchain-noble-22 main" \
| tee /etc/apt/sources.list.d/llvm.list && \
apt-get update && \
apt-get install -y --no-install-recommends clang-22 clangd-22 clang-format-22 lldb-22 && \
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-22 100 && \
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-22 100 && \
update-alternatives --install /usr/bin/clangd clangd /usr/bin/clangd-22 100 && \
update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-22 100 && \
update-alternatives --install /usr/bin/lldb lldb /usr/bin/lldb-22 100 && \
apt-get autoremove -y && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/*

# Generate/load ssh key and setup unison
RUN --mount=type=bind,target=/tmp/.ssh,source=.ssh,readonly=false \
cd /home/ubuntu && mkdir -p .ssh && \
Expand All@@ -111,6 +117,11 @@ RUN curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linu
tar -C /opt -xzf nvim-linux-x86_64.tar.gz && \
rm nvim-linux-x86_64.tar.gz

# Install latest stable cmake for user ubuntu
RUN wget https://github.com/kitware/cmake/releases/download/v4.2.3/cmake-4.2.3-linux-x86_64.sh -O install.sh && \
mkdir -p /opt/cmake/ && bash install.sh --skip-license --prefix=/opt/cmake/ --exclude-subdir && \
rm install.sh
Comment on lines +120 to +123

@coderabbitaicoderabbitaiBotFeb 13, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

cmake 4.2.3 release

💡 Result:

CMake 4.2.3 was released and made available for download on January 29, 2026. [1][2]

  • It is listed as the latest stable release on the official CMake download page. [3]
  • The 4.2.3 section of the CMake 4.2 release notes says it introduces no changes to documented features or interfaces, only implementation updates (ecosystem support and/or regression fixes). [4]
  • The release announcement’s shortlog highlights a small set of changes since 4.2.2, including a libarchive Windows path tolerance fix and a CUDA test fix. [1][2]

Sources: [1][2][3][4]


🏁 Script executed:

# Find the Dockerfile and read the specific lines mentioned
fd -type f -name "Dockerfile"| head -5

Repository: Alliance-Algorithm/RMCS

Length of output: 237


🏁 Script executed:

# Find Dockerfile using git or direct fd
git ls-files | grep -i dockerfile
# If that doesn't work, try direct path
ls -la | grep -i dockerfile

Repository: Alliance-Algorithm/RMCS

Length of output: 138


🏁 Script executed:

# Read the Dockerfile to check the specific lines mentioned
cat -n Dockerfile | sed -n '75,145p'

Repository: Alliance-Algorithm/RMCS

Length of output: 3973


cmake 4.2.3 安装到 /opt/cmake/ 但未加入 PATH,且与 apt 安装的 cmake 重复

第 81 行已通过 apt-get install 安装了系统 cmake,第 120-122 行又将 cmake 4.2.3 安装到 /opt/cmake/。但第 137 行将 PATH 导出注释掉了,因此 /opt/cmake/bin 不会出现在 $PATH 中,用户实际使用的仍是 apt 安装的旧版本 cmake。

这意味着:

  • /opt/cmake/ 占用了镜像空间但未被使用
  • 如果 PR 目标是切换到 cmake 4.2.3,则 PATH 导出不应被注释

请确认意图:若确实需要 cmake 4.2.3,应取消注释第 137 行;若不需要,则应移除此 RUN 块以减小镜像体积。

🤖 Prompt for AI Agents
In `@Dockerfile` around lines 119 - 122, The Dockerfile installs cmake 4.2.3 into
/opt/cmake/ but the PATH export that would add /opt/cmake/bin is commented out,
so the image still uses the apt-installed cmake and wastes space; either remove
the RUN block that downloads/installs cmake into /opt/cmake/ to shrink the
image, or enable the PATH update so the new cmake is used (uncomment the PATH
export that adds /opt/cmake/bin), and ensure the chosen approach is consistent
with the intent to use cmake 4.2.3 or the system cmake.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

未来项目会引入 cxx module,这是预安装

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@creeper5820 理解了,感谢说明!既然是为未来引入 C++ modules 预先安装 cmake 4.2.3,这个做法是合理的。当项目开始使用 C++ modules 时,记得取消注释第 137 行的 PATH 导出,让新版本 cmake 生效即可。

提前准备好工具链可以避免后续重新构建镜像的麻烦。👍


✏️ Learnings added
Learnt from: creeper5820
Repo: Alliance-Algorithm/RMCS PR: 46
File: Dockerfile:120-123
Timestamp: 2026-02-13T01:59:45.655Z
Learning: In the RMCS project Dockerfile, cmake 4.2.3 is pre-installed to /opt/cmake/ for future C++ modules support. The PATH export is currently commented out and will be enabled when C++ modules are introduced to the project.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


# Change user
RUN chsh -s /bin/zsh ubuntu && \
echo "ubuntu ALL=(ALL:ALL) NOPASSWD:ALL" >> /etc/sudoers
Expand All@@ -124,12 +135,14 @@ RUN sh -c "$(wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools
sed -i 's/ZSH_THEME=\"[a-z0-9\-]*\"/ZSH_THEME="af-magic"/g' ~/.zshrc && \
echo 'source ~/env_setup.zsh' >> ~/.zshrc && \
echo 'export PATH="${PATH}:/opt/nvim-linux-x86_64/bin"' >> ~/.zshrc && \
# echo 'export PATH="${PATH}:/opt/cmake/bin"' >> ~/.zshrc && \
echo 'export PATH="${PATH}:${RMCS_PATH}/.script"' >> ~/.zshrc

# Copy environment setup scripts
COPY --chown=1000:1000 .script/template/env_setup.bash env_setup.bash
COPY --chown=1000:1000 .script/template/env_setup.zsh env_setup.zsh


# Runtime container, will automatically launch the main program
FROM rmcs-base AS rmcs-runtime

Expand Down
13 changes: 3 additions & 10 deletions docker-compose.yml
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,16 @@
services:
rmcs-develop:
image: qzhhhi/rmcs-develop:latest
user: "${CONTAINER_USER}"
privileged: true
command: >
bash -c "
sudo chown -R ${CONTAINER_USER}:${CONTAINER_USER} ${CONTAINER_HOME}/.config
exec bash
"
user: "1000:1000"
volumes:
- /dev:/dev:bind
- /tmp/.X11-unix:/tmp/.X11-unix:bind
- /run/user/1000/wayland-0:/run/user/1000/wayland-0
- /run/user/1000/wayland-0:/run/user/1000/wayland-0:bind
- ${HOST_NVIM_DIR}:${CONTAINER_HOME}/.config/nvim/:bind
- .:/workspaces/RMCS:bind
environment:
- DISPLAY=${DISPLAY}
- WAYLAND_DISPLAY=${WAYLAND_DISPLAY}
network_mode: host
tty: true
stdin_open: true

stdin_open: true