@@ -25,6 +25,14 @@ RUN gpg --import /tmp/nginx_public_keys.key &&\
2525 rm /tmp/nginx_public_keys.key &&\
2626 /tmp/install-nginx
2727
28+ FROM builder AS thpfoff_builder
29+
30+ # This tool allows us to disable huge page support for our current process
31+ # since the flag is preserved through forks and execs it can be used on any
32+ # process
33+ ADD thpoff.c /src/thpoff.c
34+ RUN gcc -o /usr/local/sbin/thpoff /src/thpoff.c && rm /src/thpoff.c
35+
2836FROM discourse/ruby:3.3.6-${DEBIAN_RELEASE}-slim AS discourse_dependencies
2937
3038ARG DEBIAN_RELEASE
@@ -51,14 +59,14 @@ RUN --mount=type=tmpfs,target=/var/log \
5159 echo "debconf debconf/frontend select Teletype" | debconf-set-selections; \
5260 apt-get -y update && DEBIAN_FRONTEND=noninteractive apt-get -y install gnupg sudo curl fping locales \
5361 ca-certificates rsync \
54- cmake g++ pkg-config patch \
55- libxslt-dev libcurl4-openssl-dev \
56- libssl-dev libyaml-dev libtool \
62+ cmake g++ patch \
63+ libcurl4-openssl-dev \
64+ libssl-dev libyaml-dev \
5765 libpcre3 libpcre3-dev zlib1g zlib1g-dev \
58- libxml2-dev gawk parallel \
66+ gawk \
5967 libreadline-dev anacron wget \
6068 psmisc whois brotli libunwind-dev \
61- libtcmalloc-minimal4 cmake \
69+ libtcmalloc-minimal4 \
6270 pngcrush pngquant ripgrep poppler-utils \
6371# imagemagick runtime dependencies
6472 libheif1 libjbig0 libtiff6 libpng16-16 libfontconfig1 \
@@ -133,11 +141,7 @@ RUN gem install pups --force &&\
133141 mkdir -p /pups/bin/ &&\
134142 ln -s /usr/local/bin/pups /pups/bin/pups
135143
136- # This tool allows us to disable huge page support for our current process
137- # since the flag is preserved through forks and execs it can be used on any
138- # process
139- ADD thpoff.c /src/thpoff.c
140- RUN gcc -o /usr/local/sbin/thpoff /src/thpoff.c && rm /src/thpoff.c
144+ COPY --from=thpfoff_builder /usr/local/sbin/thpoff /usr/local/sbin/thpoff
141145
142146# clean up for docker squash
143147RUN rm -fr /usr/local/share/doc &&\
0 commit comments