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
65 lines
1.6 KiB
Docker
65 lines
1.6 KiB
Docker
# Ultra-optimized Alpine-based image for Woodpecker CI
|
|
# Size: ~400-500MB (vs 2.47GB original)
|
|
#
|
|
# Build: docker build -t your-registry/typedialog-ci:alpine -f .woodpecker/Dockerfile.alpine .
|
|
# Push: docker push your-registry/typedialog-ci:alpine
|
|
|
|
# Stage 1: Builder
|
|
FROM rust:1.92-alpine AS builder
|
|
|
|
# Install build dependencies
|
|
RUN apk add --no-cache \
|
|
musl-dev \
|
|
openssl-dev \
|
|
openssl-libs-static \
|
|
pkgconfig
|
|
|
|
# Set static linking for smaller binaries
|
|
ENV RUSTFLAGS="-C target-feature=+crt-static"
|
|
|
|
# Install Rust tools
|
|
RUN cargo install \
|
|
cargo-audit \
|
|
cargo-deny \
|
|
cargo-sbom \
|
|
nickel-lang-cli \
|
|
nu \
|
|
--locked
|
|
|
|
# Stage 2: Final image
|
|
FROM rust:1.92-alpine
|
|
|
|
# Install runtime dependencies
|
|
RUN apk add --no-cache \
|
|
shellcheck \
|
|
git \
|
|
curl \
|
|
ca-certificates \
|
|
openssl \
|
|
libgcc
|
|
|
|
# Install just
|
|
RUN curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | sh -s -- --to /usr/local/bin
|
|
|
|
# Install Rust components
|
|
RUN rustup component add clippy rustfmt
|
|
|
|
# Copy compiled binaries from builder
|
|
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
|