PHP: update examples (#28159)

* PHP: update examples

* Fix templates
pull/28237/head
Stanley Cheung 3 years ago committed by GitHub
parent 789e8b33c8
commit f3ef6869d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      examples/php/echo/README.md
  2. 5
      examples/php/echo/apache.Dockerfile
  3. 18
      examples/php/echo/base.Dockerfile
  4. 5
      examples/php/echo/cli.Dockerfile
  5. 5
      examples/php/echo/fpm.Dockerfile
  6. 18
      templates/examples/php/echo/base.Dockerfile.template
  7. 5
      templates/examples/php/echo/copy_from_grpc_base.include

@ -12,7 +12,7 @@ For all the following examples, we use a simple gRPC server, written in Node.
```sh
$ git clone https://github.com/grpc/grpc-web
$ cd grpc-web
$ docker-compose build common node-server
$ docker-compose build prereqs node-server
$ docker run -d -p 9090:9090 --name node-server grpcweb/node-server
```

@ -25,9 +25,10 @@ RUN apt-get -qq update && apt-get -qq install -y git
COPY --from=composer /usr/bin/composer /usr/bin/composer
COPY --from=grpc-base /usr/local/bin/protoc /usr/local/bin/protoc
COPY --from=grpc-base /github/grpc/cmake/build/third_party/protobuf/protoc \
/usr/local/bin/protoc
COPY --from=grpc-base /github/grpc/bins/opt/grpc_php_plugin \
COPY --from=grpc-base /github/grpc/cmake/build/grpc_php_plugin \
/usr/local/bin/protoc-gen-grpc
COPY --from=grpc-base \

@ -15,26 +15,20 @@
FROM php:7.2-stretch
RUN apt-get -qq update && apt-get -qq install -y \
autoconf automake curl git libtool \
autoconf automake cmake curl git libtool \
pkg-config unzip zlib1g-dev
ARG MAKEFLAGS=-j8
WORKDIR /tmp
RUN curl -sSL https://github.com/protocolbuffers/protobuf/releases/download/v3.8.0/\
protoc-3.8.0-linux-x86_64.zip -o /tmp/protoc.zip && \
unzip -qq protoc.zip && \
cp /tmp/bin/protoc /usr/local/bin/protoc
WORKDIR /github/grpc
RUN git clone https://github.com/grpc/grpc . && \
git submodule update --init && \
cd third_party/protobuf && git submodule update --init
git submodule update --init --recursive
WORKDIR /github/grpc/cmake/build
RUN make grpc_php_plugin
RUN cmake ../.. && \
make protoc grpc_php_plugin
RUN pecl install grpc

@ -25,9 +25,10 @@ RUN apt-get -qq update && apt-get -qq install -y git
COPY --from=composer /usr/bin/composer /usr/bin/composer
COPY --from=grpc-base /usr/local/bin/protoc /usr/local/bin/protoc
COPY --from=grpc-base /github/grpc/cmake/build/third_party/protobuf/protoc \
/usr/local/bin/protoc
COPY --from=grpc-base /github/grpc/bins/opt/grpc_php_plugin \
COPY --from=grpc-base /github/grpc/cmake/build/grpc_php_plugin \
/usr/local/bin/protoc-gen-grpc
COPY --from=grpc-base \

@ -25,9 +25,10 @@ RUN apt-get -qq update && apt-get -qq install -y git
COPY --from=composer /usr/bin/composer /usr/bin/composer
COPY --from=grpc-base /usr/local/bin/protoc /usr/local/bin/protoc
COPY --from=grpc-base /github/grpc/cmake/build/third_party/protobuf/protoc \
/usr/local/bin/protoc
COPY --from=grpc-base /github/grpc/bins/opt/grpc_php_plugin \
COPY --from=grpc-base /github/grpc/cmake/build/grpc_php_plugin \
/usr/local/bin/protoc-gen-grpc
COPY --from=grpc-base \

@ -17,26 +17,20 @@
FROM php:${settings.php_version.php_current_version()}-${settings.php_version.php_debian_version()}
RUN apt-get -qq update && apt-get -qq install -y ${'\\'}
autoconf automake curl git libtool ${'\\'}
autoconf automake cmake curl git libtool ${'\\'}
pkg-config unzip zlib1g-dev
ARG MAKEFLAGS=-j8
WORKDIR /tmp
RUN curl -sSL https://github.com/protocolbuffers/protobuf/releases/download/v3.8.0/${'\\'}
protoc-3.8.0-linux-x86_64.zip -o /tmp/protoc.zip && ${'\\'}
unzip -qq protoc.zip && ${'\\'}
cp /tmp/bin/protoc /usr/local/bin/protoc
WORKDIR /github/grpc
RUN git clone https://github.com/grpc/grpc . && ${'\\'}
git submodule update --init && ${'\\'}
cd third_party/protobuf && git submodule update --init
git submodule update --init --recursive
WORKDIR /github/grpc/cmake/build
RUN make grpc_php_plugin
RUN cmake ../.. && ${'\\'}
make protoc grpc_php_plugin
RUN pecl install grpc

@ -1,8 +1,9 @@
COPY --from=composer /usr/bin/composer /usr/bin/composer
COPY --from=grpc-base /usr/local/bin/protoc /usr/local/bin/protoc
COPY --from=grpc-base /github/grpc/cmake/build/third_party/protobuf/protoc ${'\\'}
/usr/local/bin/protoc
COPY --from=grpc-base /github/grpc/bins/opt/grpc_php_plugin ${'\\'}
COPY --from=grpc-base /github/grpc/cmake/build/grpc_php_plugin ${'\\'}
/usr/local/bin/protoc-gen-grpc
COPY --from=grpc-base ${'\\'}

Loading…
Cancel
Save