Skip to content

Commit 4c86455

Browse files
committed
Updates docker file and build config
1 parent f6b6de9 commit 4c86455

File tree

3 files changed

+23
-56
lines changed

3 files changed

+23
-56
lines changed

.github/workflows/build-xdebug.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,21 @@ jobs:
3636
context: ./
3737
file: ./Dockerfile
3838
push: true
39-
tags:
40-
${{ secrets.DOCKER_HUB_ORG }}/php81-grpc:latest, ${{ secrets.DOCKER_HUB_ORG }}/php81-grpc:${{ steps.previoustag.outputs.tag }}
39+
platforms: linux/amd64,linux/arm64
40+
tags: |
41+
${{ secrets.DOCKER_HUB_ORG }}/php81-grpc:latest
42+
${{ secrets.DOCKER_HUB_ORG }}/php81-grpc:${{ steps.previoustag.outputs.tag }}
43+
44+
- name: Build and push with xdebug
45+
id: docker_build
46+
uses: docker/build-push-action@v2
47+
with:
48+
context: ./
49+
file: ./Dockerfile
50+
push: true
51+
platforms: linux/amd64,linux/arm64
52+
build-args:
53+
XDEBUG_ENABLED=true
54+
tags: |
55+
${{ secrets.DOCKER_HUB_ORG }}/php81-grpc:${{ steps.previoustag.outputs.tag }}-xdebug
56+

Dockerfile

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ARG PHP_IMAGE=8.1.3-cli-alpine3.15
22

3-
FROM php:$PHP_IMAGE
3+
FROM --platform=${TARGETPLATFORM:-linux/amd64} php:$PHP_IMAGE as builder
44

55
# Basic libs
66
RUN apk update
@@ -44,17 +44,9 @@ RUN apk add --no-cache \
4444

4545
RUN rm -rf /var/lib/apt/lists/*
4646

47-
WORKDIR /tmp
48-
RUN git clone https://github.com/grpc/grpc.git
49-
50-
WORKDIR /tmp/grpc
51-
RUN git submodule update --init
52-
53-
WORKDIR /tmp/grpc/src/php/ext/grpc
54-
RUN phpize
55-
RUN ./configure
56-
RUN make -j 16
57-
RUN make install
47+
ARG PROTOBUF_VERSION="3.21.1"
48+
RUN pecl channel-update pecl.php.net \
49+
&& MAKEFLAGS="-j $(nproc)" pecl install protobuf-${PROTOBUF_VERSION} grpc \
5850

5951
RUN docker-php-ext-install \
6052
opcache \
@@ -75,6 +67,7 @@ RUN pecl install -o -f \
7567
RUN docker-php-ext-enable \
7668
redis \
7769
imagick \
70+
protobuf \
7871
grpc
7972

8073
ARG XDEBUG_ENABLED=false

0 commit comments

Comments
 (0)