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
51 lines
1.4 KiB
Docker
51 lines
1.4 KiB
Docker
# Dockerfile for cross-platform compilation
|
|
# Supports building for multiple targets using docker
|
|
|
|
FROM ubuntu:22.04
|
|
|
|
# Install build essentials
|
|
RUN apt-get update && apt-get install -y \
|
|
build-essential \
|
|
curl \
|
|
git \
|
|
pkg-config \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install Rust
|
|
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
|
|
ENV PATH="/root/.cargo/bin:${PATH}"
|
|
|
|
# Install cross tool for cross-compilation
|
|
RUN cargo install cross
|
|
|
|
# Create workspace directory
|
|
WORKDIR /workspace
|
|
|
|
# Copy entire project
|
|
COPY . .
|
|
|
|
# Default build target
|
|
ARG TARGET=x86_64-unknown-linux-gnu
|
|
ENV BUILD_TARGET="${TARGET}"
|
|
|
|
# Build command
|
|
RUN cross build --target "${BUILD_TARGET}" --release
|
|
|
|
# Extract binaries to output directory
|
|
RUN mkdir -p /output/bin && \
|
|
for binary in typedialog typedialog-tui typedialog-web typedialog-ai typedialog-ag typedialog-ag-server typedialog-prov-gen; do \
|
|
if [ -f "target/${BUILD_TARGET}/release/${binary}" ]; then \
|
|
cp "target/${BUILD_TARGET}/release/${binary}" /output/bin/ || \
|
|
cp "target/${BUILD_TARGET}/release/${binary}.exe" /output/bin/; \
|
|
fi; \
|
|
done
|
|
|
|
# Copy configuration
|
|
RUN cp -r config /output/
|
|
|
|
# Create manifest
|
|
RUN echo "{ \"target\": \"${BUILD_TARGET}\", \"built\": \"$(date -u +'%Y-%m-%dT%H:%M:%SZ')\" }" > /output/BUILD_INFO.json
|
|
|
|
# Default command
|
|
CMD ["/bin/bash"]
|