actually build it
All checks were successful
Build Docker Image on Commit / build-and-publish (push) Successful in 2m48s

This commit is contained in:
Merith 2025-06-09 21:18:20 -07:00
parent 0b85953713
commit 301f299272

View file

@ -1,36 +1,49 @@
# STAGE 1: Build CraftOS-PC # Stage 1: Build CraftOS-PC with musl using Alpine
FROM alpine:latest as builder FROM alpine:latest AS builder
RUN apk add --no-cache git cmake g++ make mono-msbuild mono-dev zlib-dev # Install build tools
RUN apk add --no-cache \
git \
autoconf \
automake \
libtool \
make \
g++ \
sdl2-dev \
zlib-dev \
mesa-dev \
libx11-dev \
libxrandr-dev \
libxext-dev \
libxinerama-dev \
libxcursor-dev \
openssl-dev \
poco-dev \
harfbuzz-dev
WORKDIR /src WORKDIR /build
# Clone the repository and get latest tag # Clone and checkout latest tag
RUN git clone https://github.com/MCJack123/craftos2.git . \ RUN git clone https://github.com/MCJack123/craftos2.git . \
&& git fetch --tags \ && git fetch --tags \
&& LATEST_TAG=$(git tag | sort -V | tail -n 1) \ && LATEST_TAG=$(git tag | sort -V | tail -n 1) \
&& git checkout "$LATEST_TAG" \ && git checkout "$LATEST_TAG" \
&& git submodule update --init --recursive && git submodule update --init --recursive
# Attempt to build CraftOS-PC using MSBuild # Run build process via Autotools
# Note: This assumes CraftOS-PC is buildable on Linux using mono-msbuild RUN ./configure \
RUN msbuild "CraftOS-PC 2.sln" /p:Configuration=Release && cd craftos2-luajit && make -j$(nproc) \
&& make -C src -j$(nproc)
# Assuming output binary ends up in a known location (adjust as needed)
# For example, `bin/Release/net462` or similar, and ROM is under `CraftOS-PC/ROM`
RUN mkdir /output && cp -r ROM /output/ROM \
&& find . -type f -name 'CraftOS-PC*' -executable -exec cp {} /output/ \;
# STAGE 2: Final image with CraftOS-PC # Stage 2: Alpine runtime container
FROM git.merith.xyz/gns3/base-vnc:latest FROM git.merith.xyz/gns3/base-vnc:latest
# Copy entrypoint
COPY ./entrypoint.sh /entrypoint.sh COPY ./entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh RUN chmod +x /entrypoint.sh
# Copy build output # Copy binary + ROM
COPY --from=builder /output /opt/craftos COPY --from=builder /build /opt/craftos-build
# Optional: Add to PATH or set working directory
ENV PATH="/opt/craftos:$PATH"
WORKDIR /opt/craftos WORKDIR /opt/craftos
ENV PATH="/opt/craftos:$PATH"