Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect the PHP version for the al2023 docker build. #95

Merged
merged 2 commits into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions docker/al2.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@ RUN pecl install igbinary && \
ARG RELAY=v0.6.5

# Download Relay
RUN PLATFORM=$(uname -m | sed 's/_/-/') \
&& curl -L "https://builds.r2.relay.so/$RELAY/relay-$RELAY-php8.0-centos7-$PLATFORM.tar.gz" | tar xz -C /tmp
RUN ARCH=$(uname -m | sed 's/_/-/') \
PHP=$(php -r 'echo substr(PHP_VERSION, 0, 3);') \
&& curl -L "https://builds.r2.relay.so/$RELAY/relay-$RELAY-php$PHP-centos7-$ARCH.tar.gz" | tar xz -C /tmp

# Copy relay.{so,ini}
RUN PLATFORM=$(uname -m | sed 's/_/-/') \
&& cp "/tmp/relay-$RELAY-php8.0-centos7-$PLATFORM/relay.ini" $(php-config --ini-dir)/50-relay.ini \
&& cp "/tmp/relay-$RELAY-php8.0-centos7-$PLATFORM/relay-pkg.so" $(php-config --extension-dir)/relay.so
RUN ARCH=$(uname -m | sed 's/_/-/') \
&& cp "/tmp/relay-$RELAY-php8.0-centos7-$ARCH/relay.ini" $(php-config --ini-dir)/50-relay.ini \
&& cp "/tmp/relay-$RELAY-php8.0-centos7-$ARCH/relay-pkg.so" $(php-config --extension-dir)/relay.so

# Inject UUID
RUN sed -i "s/00000000-0000-0000-0000-000000000000/$(cat /proc/sys/kernel/random/uuid)/" $(php-config --extension-dir)/relay.so
3 changes: 2 additions & 1 deletion docker/al2023.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ RUN pecl install igbinary && \
ARG RELAY=v0.6.5

RUN ARCH=$(uname -m | sed 's/_/-/') \
ARTIFACT="https://builds.r2.relay.so/$RELAY/relay-$RELAY-php8.1-el9-$ARCH.tar.gz" \
PHP=$(php -r 'echo substr(PHP_VERSION, 0, 3);') \
ARTIFACT="https://builds.r2.relay.so/$RELAY/relay-$RELAY-php$PHP-el9-$ARCH.tar.gz" \
&& curl -sfSL $ARTIFACT | tar xz --strip-components=1 -C /tmp

# Copy relay.{so,ini}
Expand Down
3 changes: 2 additions & 1 deletion docker/el9/el9.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ RUN dnf -y install \

# Download Relay
RUN ARCH=$(uname -m | sed 's/_/-/') \
ARTIFACT="https://builds.r2.relay.so/$RELAY/relay-$RELAY-php8.2-el9-$ARCH.tar.gz" \
PHP=$(php -r 'echo substr(PHP_VERSION, 0, 3);') \
ARTIFACT="https://builds.r2.relay.so/$RELAY/relay-$RELAY-php$PHP-el9-$ARCH.tar.gz" \
&& curl -L $ARTIFACT | tar -xz --strip-components=1 -C /tmp

# Copy relay.{so,ini}
Expand Down
11 changes: 6 additions & 5 deletions docker/ubuntu/ubuntu20.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ RUN apt-get install -y \
ARG RELAY=v0.6.5

# Download Relay
RUN PLATFORM=$(uname -m | sed 's/_/-/') \
&& curl -L "https://builds.r2.relay.so/$RELAY/relay-$RELAY-php7.4-debian-$PLATFORM.tar.gz" | tar xz -C /tmp
RUN ARCH=$(uname -m | sed 's/_/-/') \
PHP=$(php -r 'echo substr(PHP_VERSION, 0, 3);') \
&& curl -L "https://builds.r2.relay.so/$RELAY/relay-$RELAY-php$PHP-debian-$ARCH.tar.gz" | tar xz -C /tmp

# Copy relay.{so,ini}
RUN PLATFORM=$(uname -m | sed 's/_/-/') \
&& cp "/tmp/relay-$RELAY-php7.4-debian-$PLATFORM/relay.ini" $(php-config --ini-dir)/30-relay.ini \
&& cp "/tmp/relay-$RELAY-php7.4-debian-$PLATFORM/relay-pkg.so" $(php-config --extension-dir)/relay.so
RUN ARCH=$(uname -m | sed 's/_/-/') \
&& cp "/tmp/relay-$RELAY-php7.4-debian-$ARCH/relay.ini" $(php-config --ini-dir)/30-relay.ini \
&& cp "/tmp/relay-$RELAY-php7.4-debian-$ARCH/relay-pkg.so" $(php-config --extension-dir)/relay.so

# Inject UUID
RUN sed -i "s/00000000-0000-0000-0000-000000000000/$(cat /proc/sys/kernel/random/uuid)/" $(php-config --extension-dir)/relay.so