generated from gns3/vnc-template
All checks were successful
Build Docker Image on Commit / build-and-publish (push) Successful in 2m48s
49 lines
1 KiB
Docker
49 lines
1 KiB
Docker
# Stage 1: Build CraftOS-PC with musl using Alpine
|
|
FROM alpine:latest AS builder
|
|
|
|
# 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 /build
|
|
|
|
# Clone and checkout 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
|
|
|
|
# Run build process via Autotools
|
|
RUN ./configure \
|
|
&& cd craftos2-luajit && make -j$(nproc) \
|
|
&& make -C src -j$(nproc)
|
|
|
|
|
|
# Stage 2: Alpine runtime container
|
|
FROM git.merith.xyz/gns3/base-vnc:latest
|
|
|
|
COPY ./entrypoint.sh /entrypoint.sh
|
|
RUN chmod +x /entrypoint.sh
|
|
|
|
# Copy binary + ROM
|
|
COPY --from=builder /build /opt/craftos-build
|
|
|
|
WORKDIR /opt/craftos
|
|
ENV PATH="/opt/craftos:$PATH"
|