Merge pull request #175 from pikasTech/fix/code-queue-rustup-toolchain

fix: make code queue rustup install incremental
This commit is contained in:
Lyon
2026-05-24 14:11:27 +08:00
committed by GitHub
@@ -7,7 +7,7 @@ ENV RUSTUP_HOME=/usr/local/rustup
ENV CARGO_HOME=/usr/local/cargo
ENV PATH=/usr/local/cargo/bin:${PATH}
RUN (command -v codex >/dev/null 2>&1 && command -v opencode >/dev/null 2>&1 && command -v docker >/dev/null 2>&1 && command -v gh >/dev/null 2>&1 && command -v rg >/dev/null 2>&1 && command -v cargo >/dev/null 2>&1 && command -v rustc >/dev/null 2>&1 && rustc --version | awk '{ split($2, v, "."); exit ! (v[1] > 1 || (v[1] == 1 && v[2] >= 86)) }' && command -v rustfmt >/dev/null 2>&1 && command -v xvfb-run >/dev/null 2>&1 && command -v xauth >/dev/null 2>&1 && test -x "$PLAYWRIGHT_BROWSERS_PATH/chromium_headless_shell-1217/chrome-headless-shell-linux64/chrome-headless-shell") \
RUN (command -v codex >/dev/null 2>&1 && command -v opencode >/dev/null 2>&1 && command -v docker >/dev/null 2>&1 && command -v gh >/dev/null 2>&1 && command -v rg >/dev/null 2>&1 && command -v cargo >/dev/null 2>&1 && command -v rustc >/dev/null 2>&1 && command -v rustfmt >/dev/null 2>&1 && command -v xvfb-run >/dev/null 2>&1 && command -v xauth >/dev/null 2>&1 && test -x "$PLAYWRIGHT_BROWSERS_PATH/chromium_headless_shell-1217/chrome-headless-shell-linux64/chrome-headless-shell") \
|| (apt-get update \
&& apt-get install -y --no-install-recommends \
bash \
@@ -45,8 +45,6 @@ RUN (command -v codex >/dev/null 2>&1 && command -v opencode >/dev/null 2>&1 &&
xauth \
xvfb \
xz-utils \
&& curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal --default-toolchain stable \
&& rustup component add rustfmt \
&& mkdir -p /usr/local/lib/docker/cli-plugins /root/.docker/cli-plugins \
&& ln -sf /usr/bin/docker-compose /usr/local/lib/docker/cli-plugins/docker-compose \
&& ln -sf /usr/bin/docker-compose /root/.docker/cli-plugins/docker-compose \
@@ -55,6 +53,17 @@ RUN (command -v codex >/dev/null 2>&1 && command -v opencode >/dev/null 2>&1 &&
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*)
RUN rustc --version | awk '{ split($2, v, "."); exit ! (v[1] > 1 || (v[1] == 1 && v[2] >= 86)) }' \
|| (apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates curl \
&& if ! command -v rustup >/dev/null 2>&1; then curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal --default-toolchain stable; fi \
&& rustup default stable \
&& rustup component add rustfmt \
&& hash -r 2>/dev/null || true \
&& rustc --version | awk '{ split($2, v, "."); exit ! (v[1] > 1 || (v[1] == 1 && v[2] >= 86)) }' \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*)
WORKDIR /app/src/components/microservices/code-queue
COPY src/components/microservices/code-queue/package.json ./package.json
RUN test -d node_modules/typescript || bun install