Switch Docker to Alpine and build kge.
Update build environment to Alpine, enable GUI support, and refine developer guide - Migrated Dockerfile base image from Ubuntu 22.04 to Alpine 3.19 for a smaller and faster container. - Added dependencies for GUI support (SDL2, OpenGL/Mesa, Freetype, etc.) and updated CMake options. - Enhanced `DEVELOPER_GUIDE.md` with new instructions for GUI builds, updated dependencies, and simplified custom build workflows. - Addressed Alpine-specific ncurses library path issues in CMake configuration.
This commit is contained in:
21
Dockerfile
21
Dockerfile
@@ -1,20 +1,23 @@
|
||||
# Minimal Dockerfile for building and testing kte on Linux
|
||||
# This container provides a build environment with all dependencies.
|
||||
# Mount the source tree at /kte when running the container.
|
||||
FROM ubuntu:22.04
|
||||
|
||||
# Avoid interactive prompts during package installation
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
FROM alpine:3.19
|
||||
|
||||
# Install build dependencies
|
||||
RUN apt-get update && apt-get install -y \
|
||||
build-essential \
|
||||
RUN apk add --no-cache \
|
||||
g++ \
|
||||
cmake \
|
||||
libncursesw5-dev \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
make \
|
||||
ncurses-dev \
|
||||
sdl2-dev \
|
||||
mesa-dev \
|
||||
freetype-dev \
|
||||
libx11-dev \
|
||||
libxext-dev
|
||||
|
||||
# Set working directory where source will be mounted
|
||||
WORKDIR /kte
|
||||
|
||||
# Default command: build and run tests
|
||||
CMD ["sh", "-c", "cmake -B build -DBUILD_GUI=OFF -DBUILD_TESTS=ON && cmake --build build --target kte && cmake --build build --target kte_tests && ./build/kte_tests"]
|
||||
# Add DirectFB include path for SDL2 compatibility on Alpine
|
||||
CMD ["sh", "-c", "cmake -B build -DBUILD_GUI=ON -DBUILD_TESTS=ON -DCMAKE_CXX_FLAGS='-I/usr/include/directfb' && cmake --build build --target kte && cmake --build build --target kge && cmake --build build --target kte_tests && ./build/kte_tests"]
|
||||
|
||||
Reference in New Issue
Block a user