-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
128 lines (106 loc) · 3.04 KB
/
Copy pathDockerfile
File metadata and controls
128 lines (106 loc) · 3.04 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
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
FROM ubuntu:26.04 AS base
ENV TZ=US
ENV CC=/usr/bin/clang
ENV CXX=/usr/bin/clang++
# Update
RUN apt-get upgrade -y -o Dpkg::Options::="--force-confold" && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN apt-get update && apt-get install -y --no-install-recommends wget gnupg2 ca-certificates && \
# TZ Stupidity
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && \
apt-get update && apt-get install -y --no-install-recommends \
build-essential \
cmake \
make \
git \
clang-21 \
lldb-21 \
lld-21 \
libclang-rt-21-dev \
gcc \
g++ \
gdb \
libsodium23 \
libopus0 \
libxml2-dev \
libssl3t64 \
libssl-dev \
libasio-dev \
libboost-filesystem-dev \
libboost-date-time-dev \
libboost-regex-dev \
libpython3.14 \
libpython3.14-dev \
python3-dev \
libaspell-dev \
libpspell-dev \
aspell \
aspell-en \
zlib1g-dev && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
ln -s /usr/bin/clang-21 /usr/bin/clang && \
ln -s /usr/bin/clang++-21 /usr/bin/clang++
# Prod build: bakes the source in and compiles from scratch.
FROM base AS build
WORKDIR /build
COPY . .
# Build the mud now
ARG PARALLEL=12
ARG LEAK
RUN cmake . && make -j ${PARALLEL}
# Dev sandbox: toolchain only, no source baked in. Source is bind-mounted at /src and the
# out-of-tree build dir (/build, holding .o files + _deps) is a persistent named volume,
# both supplied at `docker run` time. Stays alive to be exec'd into for incremental builds.
# See docker/dev/*.sh.
FROM base AS dev
WORKDIR /build
ARG PARALLEL=12
CMD ["sleep", "infinity"]
FROM ubuntu:26.04 AS run
# Update
RUN apt-get update && apt-get upgrade -y -o Dpkg::Options::="--force-confold" && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN apt-get update && apt-get install -y --no-install-recommends \
libxml2-16 \
python3 \
libssl3t64 \
clang-21 \
lldb-21 \
lld-21 \
libpython3.14 \
libboost-python1.90.0 \
libboost-filesystem1.90.0 \
libboost-date-time1.90.0 \
libboost-regex1.90.0 \
libsodium23 \
libopus0 \
aspell \
zlib1g \
locales \
locales-all \
gdb && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
ARG username=jason
RUN useradd ${username}
# We want the SRC, but not all the build objs, for GDB to work
WORKDIR /build
COPY . .
WORKDIR /mud
# Set correct environment variables.
EXPOSE 3333
ENV HOME /home/realms/
COPY --from=build /build/RealmsCode .
COPY --from=build /build/List .
COPY --from=build /build/Updater .
# Temporary Workaround
COPY --from=build /build/libRealmsLib.so .
COPY --from=build /build/_deps/dpp-build/library/libdpp.so.* .
COPY --from=build /build/MyLSan.supp .
ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
# Temporary Workaround
ENV LD_LIBRARY_PATH=./
ENV ASAN_OPTIONS="detect_odr_violation=0,detect_leaks=0"
ENV LSAN_OPTIONS="LSAN_OPTIONS=suppressions=../MyLSan.supp"
CMD ["/mud/RealmsCode"]