1919#
2020
2121ARG SYNAPSE_VERSION=latest
22- ARG REDIS_VERSION=7.0.8
2322
2423###
2524### Stage 2: Add-ons
@@ -41,7 +40,7 @@ ARG REDIS_VERSION=7.0.8
4140# target image. For repeated rebuilds, this is much faster than apt installing
4241# each time.
4342
44- FROM debian:bookworm -slim AS deps_base
43+ FROM debian:trixie -slim AS deps_base
4544RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
4645 --mount=type=cache,target=/var/lib/apt,sharing=locked \
4746 apt-get update -qq && \
@@ -56,11 +55,13 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
5655# based on the same debian version as the synapse image, to make sure we get
5756# the expected version of libc.
5857#
59- # We will be using the PPA version of keydb until their docker image works for bookworm
60- # FROM eqalpha/keydb:latest AS redis_base
58+ # A redis compatible image is needed. Previously, keydb was used. The debian based image that was used is not being
59+ # updated any more. Valkey is also redis compatible, and comes highly recommended
60+ FROM bitnami/valkey:latest AS redis_base
6161
6262# Do the same for the Nginx docker image.
63- FROM nginx:1.24.0 AS nginx_base
63+ # The first debian-based image based on trixie is for v1.29
64+ FROM nginx:1.29 AS nginx_base
6465
6566# The synapse auto compressor is from an image we build. It won't change much
6667# so there's no reason to not have this pre-compiled and just borrow it. This also
@@ -86,7 +87,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
8687 libevent-extra-2.1-7 \
8788 libevent-openssl-2.1-7 \
8889 libevent-pthreads-2.1-7 \
89- libhiredis0.14 \
90+ libhiredis1.1.0 \
9091 libjemalloc2 \
9192 libjpeg62-turbo \
9293 libmicrohttpd12 \
@@ -101,18 +102,6 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
101102 xmlsec1 \
102103 && rm -rf /var/lib/apt/lists/*
103104
104- # Install keydb from their supplied PPA. Preferably, the docker image would be better,
105- # but is currently compiled against ubuntu 18.04 which doesn't work with our libssl.
106- # We specifically get the keydb-tools package, as the others tend to setup service
107- # entries that are not used(and cause errors).
108- RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
109- --mount=type=cache,target=/var/lib/apt,sharing=locked \
110- echo "deb https://download.keydb.dev/open-source-dist bookworm main" | tee /etc/apt/sources.list.d/keydb.list && \
111- wget -O /etc/apt/trusted.gpg.d/keydb.gpg https://download.keydb.dev/open-source-dist/keyring.gpg && \
112- apt-get update -qq && apt-get install -yqq \
113- keydb-tools \
114- && rm -rf /var/lib/apt/lists/*
115-
116105# Prepare directories. Do it in one layer
117106RUN mkdir -p /etc/supervisor/conf.d && \
118107 mkdir /var/log/nginx /var/cache/nginx && \
@@ -124,21 +113,19 @@ RUN mkdir -p /etc/supervisor/conf.d && \
124113RUN --mount=type=cache,target=/root/.cache/pip \
125114 pip install supervisor~=4.2
126115
127- # Copy over redis and nginx
128- # COPY --from=redis_base /usr/local/bin/keydb-server /usr/local/bin
116+ # Copy over valkey and nginx
117+ COPY --from=redis_base /opt/bitnami/valkey/* /opt/bitnami/valkey/
129118
130119COPY --from=nginx_base /usr/sbin/nginx /usr/sbin
131120COPY --from=nginx_base /usr/share/nginx /usr/share/nginx
132121COPY --from=nginx_base /usr/lib/nginx /usr/lib/nginx
133- COPY --from=nginx_base /usr/lib/x86_64-linux-gnu/libssl.so.1.1 /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 /usr/lib/x86_64-linux-gnu/
122+ # COPY --from=nginx_base /usr/lib/x86_64-linux-gnu/libssl.so.1.1 /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 /usr/lib/x86_64-linux-gnu/
134123COPY --from=nginx_base /etc/nginx /etc/nginx
135124RUN rm /etc/nginx/conf.d/default.conf
136125
137- # Copy over Prometheus. Should we bring the website files. It's 10's of MB's
126+ # Copy over Prometheus. Should we bring the website files? It's 10's of MB's
138127COPY --from=deps_base /usr/bin/prometheus /usr/bin
139- COPY --from=deps_base /usr/share/prometheus/* /usr/share/prometheus
140- # And Synapse's Prometheus rule file
141- COPY /contrib/prometheus/synapse-V2.rules /etc/prometheus
128+ COPY --from=deps_base /usr/share/prometheus/* /usr/share/prometheus/
142129COPY /contrib/mtail/ /conf/mtail/
143130
144131COPY --from=tools /out /
0 commit comments