Skip to content
Snippets Groups Projects
Select Git revision
  • hugo/tx-comments
  • master default protected
  • elois-ci-refactor protected
  • gtest
  • hugo/gtest
  • json-output
  • nostr
  • 48-error-base-58-requirement-is-violated
  • no-rename
  • poka/dev
  • hugo/dev
  • tuxmain/mail
  • test-gtest
  • 0.4.3-gtest-RC1
  • 0.4.3-RC2
  • 0.4.3-RC1
  • 0.4.2
  • 0.4.1
  • 0.4.0
  • 0.3.0
  • 0.2.17
  • 0.2.16
  • 0.2.15
  • 0.2.14
  • 0.2.13
  • 0.2.12
  • 0.2.10
  • 0.2.9
  • 0.2.8
  • 0.2.7
  • 0.2.6
  • 0.2.5
32 results

Dockerfile.ci

Blame
  • Dockerfile.ci 1.39 KiB
    # Stage 1: Build environment with all dependencies
    FROM rust:slim-bookworm as builder
    
    # Install necessary dependencies
    RUN apt-get update && apt-get install -y \
        clang \
        llvm \
        make \
        file \
        git \
        curl \
        cmake \
        python3 \
        python3-dev \
        python3-pip
    
    # Clone osxcross repository and set up
    RUN git clone https://github.com/tpoechtrager/osxcross.git /opt/osxcross && \
        cd /opt/osxcross && \
        ./tools/get_dependencies.sh && \
        cd /opt/osxcross/tarballs && \
        curl -LO https://github.com/joseluisq/macosx-sdks/releases/download/10.12/MacOSX10.12.sdk.tar.xz && \
        cd /opt/osxcross && \
        UNATTENDED=yes ./build.sh
    
    # Stage 2: Create the final image with only the necessary files
    FROM rust:slim-bookworm
    
    # Install cargo-bundle
    RUN cargo install cargo-bundle
    
    RUN apt-get update && apt-get install -y --no-install-recommends clang zip; \
        apt-get clean; \
        rm -rf /var/lib/apt/lists/*;
    
    # Copy cargo plugins from the builder stage
    COPY --from=builder /opt/osxcross/target /opt/osxcross/target
    
    # Set environment variables for osxcross and Rust
    ENV PATH="/opt/osxcross/target/bin:/usr/local/cargo/bin:$PATH"
    ENV CC="o64-clang"
    ENV CXX="o64-clang++"
    
    # Add rust target for macOS
    RUN rustup target add x86_64-apple-darwin
    
    # Copy scripts
    COPY scripts/install_gcli.scpt /opt/install_gcli.scpt
    COPY scripts/Info.plist /opt/Info.plist
    
    # Define the entrypoint
    CMD ["bash"]