Some checks failed
CI / Lint (bash) (push) Has been cancelled
CI / Lint (markdown) (push) Has been cancelled
CI / Lint (nickel) (push) Has been cancelled
CI / Lint (nushell) (push) Has been cancelled
CI / Lint (rust) (push) Has been cancelled
CI / Code Coverage (push) Has been cancelled
CI / Test (macos-latest) (push) Has been cancelled
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Build (macos-latest) (push) Has been cancelled
CI / Build (ubuntu-latest) (push) Has been cancelled
CI / Build (windows-latest) (push) Has been cancelled
CI / Benchmark (push) Has been cancelled
CI / Security Audit (push) Has been cancelled
CI / License Compliance (push) Has been cancelled
61 lines
1.7 KiB
Docker
61 lines
1.7 KiB
Docker
# Optimized Docker image for Woodpecker CI
|
|
# Reduces size from 2.47GB to ~800MB using multi-stage build
|
|
#
|
|
# Build: docker build -t your-registry/typedialog-ci:latest -f .woodpecker/Dockerfile.optimized .
|
|
# Push: docker push your-registry/typedialog-ci:latest
|
|
|
|
# Stage 1: Builder - compile Rust tools
|
|
FROM rust:1.92-slim AS builder
|
|
|
|
# Install only build dependencies
|
|
RUN apt-get update && apt-get install -y \
|
|
pkg-config \
|
|
libssl-dev \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install Rust tools
|
|
RUN cargo install \
|
|
cargo-audit \
|
|
cargo-deny \
|
|
cargo-sbom \
|
|
nickel-lang-cli \
|
|
nu \
|
|
--locked
|
|
|
|
# Stage 2: Final image - copy only binaries
|
|
FROM rust:1.92-slim
|
|
|
|
# Install runtime dependencies only
|
|
RUN apt-get update && apt-get install -y \
|
|
shellcheck \
|
|
curl \
|
|
git \
|
|
ca-certificates \
|
|
libssl3 \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install just (pre-compiled binary)
|
|
RUN curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to /usr/local/bin
|
|
|
|
# Install Rust components
|
|
RUN rustup component add clippy rustfmt
|
|
|
|
# Copy compiled binaries from builder stage
|
|
COPY --from=builder /usr/local/cargo/bin/cargo-audit /usr/local/cargo/bin/
|
|
COPY --from=builder /usr/local/cargo/bin/cargo-deny /usr/local/cargo/bin/
|
|
COPY --from=builder /usr/local/cargo/bin/cargo-sbom /usr/local/cargo/bin/
|
|
COPY --from=builder /usr/local/cargo/bin/nickel /usr/local/cargo/bin/
|
|
COPY --from=builder /usr/local/cargo/bin/nu /usr/local/cargo/bin/
|
|
|
|
# Set working directory
|
|
WORKDIR /workspace
|
|
|
|
# Verify installations
|
|
RUN just --version && \
|
|
cargo --version && \
|
|
cargo audit --version && \
|
|
cargo deny --version && \
|
|
cargo sbom --version && \
|
|
nickel --version && \
|
|
nu --version
|