-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
152 lines (133 loc) · 4.86 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# Use Ubuntu 24.04 (noble) as the base image
FROM ubuntu:24.04
# Set environment variables to reduce interaction during package installation
ENV DEBIAN_FRONTEND=noninteractive \
LANG=C.UTF-8 \
LC_ALL=C.UTF-8
# Set the Ring release version
ENV RING_VERSION=1.22
# Install necessary packages
RUN apt-get update && apt-get install -y -qq --no-install-recommends \
build-essential \
wget \
unzip \
cmake \
meson \
ninja-build \
ca-certificates \
git \
unixodbc \
unixodbc-dev \
libmariadb-dev-compat \
libpq-dev \
libcurl4-gnutls-dev \
libssl-dev \
liballegro5-dev \
liballegro-image5-dev \
liballegro-ttf5-dev \
liballegro-audio5-dev \
liballegro-acodec5-dev \
liballegro-dialog5-dev \
liballegro-physfs5-dev \
qtbase5-dev \
qtchooser \
qt5-qmake \
qtbase5-dev-tools \
qtmultimedia5-dev \
libqt5multimedia5-plugins \
libqt5webkit5-dev \
libqt5serialport5-dev \
qtconnectivity5-dev \
qtdeclarative5-dev \
libqt5opengl5-dev \
libqt5texttospeech5-dev \
qtpositioning5-dev \
qt3d5-dev \
qt3d5-dev-tools \
libqt5charts5-dev \
libqt5svg5-dev \
qtwebengine5-dev \
qml-module-qtquick-controls \
qml-module-qtcharts \
mesa-common-dev \
freeglut3-dev \
libpng-dev \
libsdl2-dev \
libsdl2-net-dev \
libsdl2-mixer-dev \
libsdl2-image-dev \
libsdl2-ttf-dev \
libglew-dev \
libgl-dev \
apache2 \
libuv1-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /var/cache/apt/*
# Create /opt/raylib directory
RUN mkdir -p /opt/raylib
# Clone and build raylib
WORKDIR /opt/raylib
RUN wget -q https://github.com/raysan5/raylib/archive/refs/tags/5.0.zip \
&& unzip -q 5.0.zip \
&& cd raylib-5.0 \
&& cmake -B build -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -GNinja \
&& cmake --build build \
&& cmake --install build
# Create /opt/tilengine directory
RUN mkdir -p /opt/tilengine
# Clone and build tilengine
WORKDIR /opt/tilengine
RUN git clone --depth 1 -q https://github.com/megamarc/Tilengine . \
&& cd src \
&& make -j$(nproc) \
&& cd ../ \
&& ./install \
&& mv /usr/lib/libTilengine.so /usr/lib/libtilengine.so \
&& mv /usr/include/Tilengine.h /usr/include/tilengine.h
# Create /opt/libui-ng directory
RUN mkdir -p /opt/libui-ng
# Clone and build libui-ng
WORKDIR /opt/libui-ng
RUN git clone --depth 1 -q https://github.com/libui-ng/libui-ng . \
&& meson setup build \
&& ninja -C build \
&& ninja -C build install
# Clean up
RUN rm -rf /opt/raylib /opt/tilengine /opt/libui-ng
# Create /opt/ring directory
RUN mkdir -p /opt/ring
# Clone and build Ring
WORKDIR /opt/ring
RUN git clone --depth 1 --branch "v$RING_VERSION" -q https://github.com/ring-lang/ring .
COPY patches/ringpdfgen.patch .
COPY patches/ringfastpro.patch .
# Check the RING_VERSION and apply patches if it's under 1.22
RUN if [ "$(echo "$RING_VERSION < 1.22" | bc)" -eq 1 ]; then \
git apply ringpdfgen.patch && \
git apply ringfastpro.patch; \
fi
RUN find . -type f -name "*.sh" -exec sed -i 's/\bsudo\b//g' {} + \
&& find . -type f -name "*.sh" -exec sed -i 's/-L \/usr\/lib\/i386-linux-gnu//g' {} + \
&& find extensions/ringqt -name "*.sh" -exec sed -i 's/\bmake\b/make -j$(nproc)/g' {} + \
&& rm -rf extensions/ringraylib5/src/inux_raylib-5 \
&& rm -rf extensions/ringtilengine/linux_tilengine \
&& rm -rf extensions/ringlibui/linux \
&& sed -i 's/ -I linux_raylib-5\/include//g; s/ -L $PWD\/linux_raylib-5\/lib//g' extensions/ringraylib5/src/buildgcc.sh \
&& sed -i '/extensions\/ringraylib5\/src\/linux/d' bin/install.sh \
&& sed -i 's/ -I linux_tilengine\/include//g; s/ -L $PWD\/linux_tilengine\/lib//g' extensions/ringtilengine/buildgcc.sh \
&& sed -i '/extensions\/ringtilengine/d' bin/install.sh \
&& sed -i 's/ -I linux//g; s/ -L \$PWD\/linux//g' extensions/ringlibui/buildgcc.sh \
&& sed -i '/extensions\/ringlibui\/linux/d' bin/install.sh \
&& sed -i 's/-L \/usr\/local\/pgsql\/lib//g' extensions/ringpostgresql/buildgcc.sh \
&& cd build \
&& bash buildgcc.sh -ring -ringallegro -ringfreeglut -ringmurmurhash -ringqt-core -ringqt-light -ringqt -ringstbimage -ringzip -ringhttplib -ringmysql -ringraylib -ringtilengine -ringthreads -ringcjson -ringinternet -ringodbc -ringrogueutil -ringpdfgen -ringconsolecolors -ringlibui -ringopengl -ringsdl -ringcurl -ringlibuv -ringopenssl -ringsockets -ringfastpro -ringpostgresql -ringsqlite -ring2exe -ringpm
# Reduce image size by removing unnecessary directories
RUN rm -rf applications documents marketing samples tools/{editors,formdesigner,help2wiki,ringnotepad,tryringonline}
# Copy the entrypoint script
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# Set the working directory
WORKDIR /app
# Set the entrypoint
ENTRYPOINT ["/entrypoint.sh"]