-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
47 lines (37 loc) · 1.33 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Use the Linux GCC Qt image
FROM stateoftheartio/qt6:6.6-gcc-aqt
# Use root for apt-get commands and script installation
USER root
# Fix permissions issue for apt-get and install dependencies
RUN rm -rf /var/lib/apt/lists/* \
&& apt-get clean \
&& apt-get update \
&& apt-get install -y \
git \
cmake \
build-essential \
libgl1-mesa-dev \
libx11-dev \
libxext-dev \
libxrandr-dev \
libxi-dev \
&& apt-get clean
# Install Catch2 (if not already in libs folder)
RUN [ ! -d libs/Catch2 ] && git clone --depth 1 https://github.com/catchorg/Catch2.git libs/Catch2 \
&& cmake -S libs/Catch2 -B libs/Catch2/build \
&& cmake --build libs/Catch2/build --target install
# Set environment variables for GUI rendering
ENV DISPLAY=${DISPLAY:-:0}
VOLUME ["/tmp/.X11-unix"]
# Set the working directory
WORKDIR /qt-soliatire
# Copy the entire project into the container
COPY . .
# Install Miniaudio (if not already in libs folder)
RUN [ ! -d libs/miniaudio ] || rm -rf libs/miniaudio && git clone --depth 1 https://github.com/mackron/miniaudio.git libs/miniaudio
# Build the project
RUN cmake -S . -B build && cmake --build build
# Switch back to the default user provided by the base image
USER user
# Default command to run the Solitaire application
CMD ["./build/solitaire"]