generated from gns3/vnc-template
Some checks failed
Build Docker Image on Commit / build-and-publish (push) Failing after 8s
36 lines
1.2 KiB
Docker
36 lines
1.2 KiB
Docker
# STAGE 1: Build CraftOS-PC
|
|
FROM alpine:latest as builder
|
|
|
|
RUN apk add --no-cache git cmake g++ make mono-msbuild mono-dev zlib-dev
|
|
|
|
WORKDIR /src
|
|
|
|
# Clone the repository and get latest tag
|
|
RUN git clone https://github.com/MCJack123/craftos2.git . \
|
|
&& git fetch --tags \
|
|
&& LATEST_TAG=$(git tag | sort -V | tail -n 1) \
|
|
&& git checkout "$LATEST_TAG" \
|
|
&& git submodule update --init --recursive
|
|
|
|
# Attempt to build CraftOS-PC using MSBuild
|
|
# Note: This assumes CraftOS-PC is buildable on Linux using mono-msbuild
|
|
RUN msbuild "CraftOS-PC 2.sln" /p:Configuration=Release
|
|
|
|
# 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
|
|
FROM git.merith.xyz/gns3/base-vnc:latest
|
|
|
|
# Copy entrypoint
|
|
COPY ./entrypoint.sh /entrypoint.sh
|
|
RUN chmod +x /entrypoint.sh
|
|
|
|
# Copy build output
|
|
COPY --from=builder /output /opt/craftos
|
|
|
|
# Optional: Add to PATH or set working directory
|
|
ENV PATH="/opt/craftos:$PATH"
|
|
WORKDIR /opt/craftos
|