From 0dbe2ba88c6d2b2f4f5e3fc6e7e59dc48db69b3a Mon Sep 17 00:00:00 2001 From: "954801926@qq.com" Date: Thu, 30 Jul 2026 00:29:31 +0800 Subject: [PATCH] ci: add Linux Docker build environment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Ubuntu 22.04 + webkit2gtk-4.1 + librsvg2 + nodejs + rustup + tauri-cli - docker-compose: 绑定源码到 /workspace, 持久化 cargo/target 缓存 - 与 GH Actions ubuntu-latest job 依赖保持一致 --- Dockerfile | 38 ++++++++++++++++++++++++++++++++++++++ docker-compose.yml | 13 +++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1acd604 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,38 @@ +# Build Kimi Switch Linux packages (deb / AppImage / rpm) inside a clean +# Ubuntu 22.04 container. Used both locally (`docker compose run`) and as a +# reference for GH Actions' ubuntu-latest job. +FROM ubuntu:22.04 + +ENV DEBIAN_FRONTEND=noninteractive +ENV CARGO_TERM_COLOR=always +ENV RUSTUP_HOME=/usr/local/rustup +ENV CARGO_HOME=/usr/local/cargo +ENV PATH=/usr/local/cargo/bin:$PATH + +RUN apt-get update && apt-get install -y \ + curl \ + wget \ + git \ + build-essential \ + pkg-config \ + libssl-dev \ + libgtk-3-dev \ + libayatana-appindicator3-dev \ + librsvg2-dev \ + libwebkit2gtk-4.1-dev \ + libsoup-3.0-dev \ + libjavascriptcoregtk-4.1-dev \ + patchelf \ + file \ + nodejs \ + npm \ + python3 \ + && rm -rf /var/lib/apt/lists/* + +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --profile minimal + +RUN cargo install tauri-cli --version "^2.0" --locked + +WORKDIR /workspace + +CMD ["/bin/bash"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..3fd2382 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,13 @@ +services: + build-linux: + build: . + container_name: kimiswitch-build-linux + volumes: + - .:/workspace + - cargo-cache:/usr/local/cargo/registry + - target-cache:/workspace/src-tauri/target + working_dir: /workspace + +volumes: + cargo-cache: + target-cache: