Agent Skills
› nixopus/nixopus
› cpp-deploy
cpp-deploy
GitHub提供C/C++项目的构建与部署指南,支持CMake和Meson构建系统。通过检测项目文件自动识别,生成优化的Dockerfile以实现从源码到容器的完整打包流程。
Trigger Scenarios
需要构建或部署C/C++应用程序
项目中存在CMakeLists.txt或meson.build文件
Install
npx skills add nixopus/nixopus --skill cpp-deploy -g -y
SKILL.md
Frontmatter
{
"name": "cpp-deploy",
"metadata": {
"version": "1.0"
},
"description": "Build and deploy C\/C++ applications — CMake, Meson, Ninja, and Dockerfile patterns. Use when deploying a C or C++ project, or when CMakeLists.txt or meson.build is detected."
}
C/C++ Deployment
Detection
Project is C/C++ if CMakeLists.txt or meson.build exists in the root.
Versions
Latest CMake (or Meson) and Ninja installed during build. No explicit version pinning by default.
Build
Build Process
- Install CMake or Meson and Ninja
- Configure and build into
./build(or/build) - Executable placed in the build directory
Start Command
Executable name matches the project root directory name, located in the build directory.
Example: project my_app/ → ./build/my_app or /build/my_app.
Output
- Build directory:
/build(or./build) - Source tree not included in final container; only build artifacts
Build Systems
| File | Build system |
|---|---|
CMakeLists.txt |
CMake |
meson.build |
Meson |
Both use Ninja as the default generator/backend.
Install Stage Optimization
Copy in order:
CMakeLists.txtormeson.buildmeson.options(Meson)src/,include/, or full source tree
Base Images
| Stage | Image |
|---|---|
| Build | gcc or clang + CMake/Meson + Ninja |
| Runtime | debian:bookworm-slim or alpine (copy binary only) |
Dockerfile Patterns
CMake
FROM gcc:13-bookworm AS build
RUN apt-get update && apt-get install -y cmake ninja-build && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY CMakeLists.txt ./
COPY src src
RUN cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release && cmake --build build
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y ca-certificates libstdc++6 && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=build /app/build/my_app .
EXPOSE 8080
CMD ["./my_app"]
Meson
FROM gcc:13-bookworm AS build
RUN apt-get update && apt-get install -y meson ninja-build && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY meson.build meson.options* ./
COPY src src
RUN meson setup build -Dbuildtype=release && ninja -C build
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y ca-certificates libstdc++6 && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=build /app/build/my_app .
EXPOSE 8080
CMD ["./my_app"]
Version History
- cf05d97 Current 2026-08-20 14:51


