-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
65 lines (54 loc) · 1.29 KB
/
Dockerfile
File metadata and controls
65 lines (54 loc) · 1.29 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Stage 1: Build (Compilação)
FROM alpine:latest AS builder
RUN apk update && apk upgrade && \
apk add --no-cache \
git \
cmake \
make \
gcc \
g++ \
linux-headers \
mesa-dev \
alsa-lib-dev \
libx11-dev \
libxrandr-dev \
libxinerama-dev \
libxcursor-dev \
libxi-dev && \
rm -rf /var/cache/apk/*
WORKDIR /tmp
RUN git clone --depth=1 https://github.com/raysan5/raylib.git && \
cd raylib && \
mkdir build && cd build && \
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DPLATFORM=Desktop \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_INSTALL_PREFIX=/usr/local && \
make -j$(nproc) && \
make install
RUN git clone --depth=1 https://github.com/raylib-extras/raylib-quickstart.git /tmp/raylib-quickstart
# Stage 2: Runtime (Execução)
FROM alpine:latest
RUN apk update && apk upgrade && \
apk add --no-cache \
mesa-gl \
alsa-lib \
libx11 \
mesa-dev \
libx11-dev \
libxrandr \
libxinerama \
libxcursor \
libxi \
xeyes \
gcc \
g++ \
make && \
rm -rf /var/cache/apk/*
COPY --from=builder /usr/local /usr/local
RUN mkdir -p /app && \
cp -R /tmp/raylib-quickstart /app/raylib-quickstart || true
RUN mkdir -p /app/user_code
WORKDIR /app/user_code
VOLUME ["/app/user_code"]