Skip to content

Commit 0a6c4e2

Browse files
authored
Merge pull request #665 from tillkruss/relay-latest-version
relay: latest version by default, arm64-ready, build on AL2023 + OpenSSL 3
2 parents 89bcc84 + d27fe68 commit 0a6c4e2

3 files changed

Lines changed: 17 additions & 36 deletions

File tree

Readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ functions:
8888
| RdKafka | `${bref-extra:rdkafka-php-81}` |
8989
| Redis (phpredis) | `${bref-extra:redis-php-81}` |
9090
| Redis-Igbinary | `${bref-extra:redis-igbinary-php-81}` |
91-
| Relay | `${bref-extra:relay-php-81}` |
91+
| Relay | `${bref-extra:relay-php-82}` |
9292
| Scout APM | `${bref-extra:scoutapm-php-81}` |
9393
| Scrypt | `${bref-extra:scrypt-php-81}` |
9494
| SNMP | `${bref-extra:snmp-php-81}` |

layers/relay/Dockerfile

Lines changed: 12 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
# syntax = docker/dockerfile:1.4
22
ARG PHP_VERSION
33
ARG BREF_VERSION
4-
FROM bref/build-php-$PHP_VERSION:2 AS ext
4+
FROM bref/build-php-$PHP_VERSION:3 AS ext
55

6-
ARG RELAY_VERSION=0.9.1
6+
# Leave empty to install the latest stable release
7+
ARG RELAY_VERSION=0.30.0
78

89
# Docs: https://relay.so/docs/1.x/installation#manual-installation
910

10-
# Install extensions required by Relay
11+
# Install optional extensions
1112
RUN pecl install igbinary msgpack && \
1213
cp `php-config --extension-dir`/igbinary.so /tmp/igbinary.so && \
1314
cp `php-config --extension-dir`/msgpack.so /tmp/msgpack.so && \
@@ -26,41 +27,17 @@ RUN <<'END' bash -e
2627
END
2728

2829

29-
# Install OpenSSL 1.1 because Relay doesn't work with OpenSSL 3
30-
# https://github.com/openssl/openssl/releases
31-
ENV VERSION_OPENSSL=1.1.1w
32-
ENV OPENSSL_BUILD_DIR=${BUILD_DIR}/openssl
33-
ENV CA_BUNDLE_SOURCE="https://curl.se/ca/cacert.pem"
34-
ENV CA_BUNDLE="${INSTALL_DIR}/bref/ssl/cert.pem"
35-
RUN rm -rf ${OPENSSL_BUILD_DIR}
36-
RUN set -xe; \
37-
mkdir -p ${OPENSSL_BUILD_DIR}; \
38-
curl -Ls https://github.com/openssl/openssl/archive/OpenSSL_${VERSION_OPENSSL//./_}.tar.gz \
39-
| tar xzC ${OPENSSL_BUILD_DIR} --strip-components=1
40-
WORKDIR ${OPENSSL_BUILD_DIR}/
41-
RUN CFLAGS="" \
42-
CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \
43-
LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \
44-
./config \
45-
--prefix=${INSTALL_DIR} \
46-
--openssldir=${INSTALL_DIR}/bref/ssl \
47-
--release \
48-
no-tests \
49-
shared \
50-
zlib
51-
# Explicitly compile make without parallelism because it fails if we use -jX (no error message)
52-
# I'm not 100% sure why, and I already lost 4 hours on this, but I found this:
53-
# https://github.com/openssl/openssl/issues/9931
54-
# https://stackoverflow.com/questions/28639207/why-cant-i-compile-openssl-with-multiple-threads-make-j3
55-
# Run `make install_sw install_ssldirs` instead of `make install` to skip installing man pages https://github.com/openssl/openssl/issues/8170
56-
RUN make -j1 install_sw install_ssldirs
57-
RUN mkdir -p ${INSTALL_DIR}/bref/ssl && curl -Lk -o ${CA_BUNDLE} ${CA_BUNDLE_SOURCE}
58-
59-
6030
RUN <<'END' bash -e
6131
export php_version=$(php-config --version | cut -c -3)
32+
# Resolve the latest stable release when no version is pinned
33+
if [ -z "$RELAY_VERSION" ]; then
34+
RELAY_VERSION=$(curl -sSL "https://builds.r2.relay.so/meta/latest" | sed 's/^v//')
35+
fi
36+
# Relay's arch suffix: x86_64 -> x86-64, aarch64 stays aarch64
37+
ARCH=$(uname -m | sed 's/_/-/')
38+
# el9 build links the system OpenSSL 3 / glibc from Amazon Linux 2023
6239
mkdir -p /tmp/relay
63-
curl -sSL "https://builds.r2.relay.so/v$RELAY_VERSION/relay-v$RELAY_VERSION-php$php_version-centos7-x86-64.tar.gz" | tar -xz --strip-components=1 -C /tmp/relay
40+
curl -sSL "https://builds.r2.relay.so/v$RELAY_VERSION/relay-v$RELAY_VERSION-php$php_version-el9-$ARCH.tar.gz" | tar -xz --strip-components=1 -C /tmp/relay
6441
sed -i "s/00000000-0000-0000-0000-000000000000/$(cat /proc/sys/kernel/random/uuid)/" /tmp/relay/relay-pkg.so
6542
cp /tmp/relay/relay-pkg.so /tmp/relay.so
6643
echo 'extension=relay.so' > /tmp/ext-relay.ini

layers/relay/config.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
{
22
"php": [
3+
"82",
4+
"83",
5+
"84",
6+
"85"
37
]
48
}

0 commit comments

Comments
 (0)