|
| 1 | +# |
| 2 | +# Licensed to the Apache Software Foundation (ASF) under one or more |
| 3 | +# contributor license agreements. See the NOTICE file distributed with |
| 4 | +# this work for additional information regarding copyright ownership. |
| 5 | +# The ASF licenses this file to You under the Apache License, Version 2.0 |
| 6 | +# (the "License"); you may not use this file except in compliance with |
| 7 | +# the License. You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, software |
| 12 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | +# See the License for the specific language governing permissions and |
| 15 | +# limitations under the License. |
| 16 | +# |
| 17 | + |
| 18 | +FROM golang:1.12 as builder |
| 19 | +RUN env CGO_ENABLED=0 go get github.com/apache/openwhisk-runtime-go/main && mv /go/bin/main /bin/proxy |
| 20 | +#ENV PROXY_SOURCE=https://github.com/apache/openwhisk-runtime-go/archive/golang1.11@1.13.0-incubating.tar.gz |
| 21 | +#RUN curl -L "$PROXY_SOURCE" | tar xzf - \ |
| 22 | +# && mkdir -p src/github.com/apache \ |
| 23 | +# && mv openwhisk-runtime-go-golang1.11-1.13.0-incubating \ |
| 24 | +# src/github.com/apache/incubator-openwhisk-runtime-go \ |
| 25 | +# && cd src/github.com/apache/incubator-openwhisk-runtime-go/main \ |
| 26 | +# && CGO_ENABLED=0 go build -o /bin/proxy |
| 27 | + |
| 28 | +FROM php:7.4.0-cli-buster |
| 29 | + |
| 30 | +# install dependencies |
| 31 | +RUN \ |
| 32 | + apt-get -y update && \ |
| 33 | + apt-get -y install \ |
| 34 | + libfreetype6-dev \ |
| 35 | + libicu-dev \ |
| 36 | + libicu63 \ |
| 37 | + libjpeg-dev \ |
| 38 | + libpng-dev \ |
| 39 | + libssl-dev \ |
| 40 | + libxml2-dev \ |
| 41 | + libzip-dev \ |
| 42 | + postgresql-server-dev-11 \ |
| 43 | + unzip \ |
| 44 | + zlib1g-dev |
| 45 | + |
| 46 | +# Install useful PHP extensions |
| 47 | +RUN \ |
| 48 | + docker-php-ext-install \ |
| 49 | + bcmath \ |
| 50 | + gd \ |
| 51 | + intl \ |
| 52 | + mysqli \ |
| 53 | + opcache \ |
| 54 | + pdo_mysql \ |
| 55 | + pdo_pgsql \ |
| 56 | + soap \ |
| 57 | + zip \ |
| 58 | + && pecl install mongodb \ |
| 59 | + && docker-php-ext-enable mongodb |
| 60 | + |
| 61 | +COPY php.ini /usr/local/etc/php |
| 62 | + |
| 63 | +# install composer |
| 64 | +RUN curl -s -f -L -o /tmp/installer.php https://getcomposer.org/installer \ |
| 65 | + && php /tmp/installer.php --no-ansi --install-dir=/usr/bin --filename=composer \ |
| 66 | + && composer --ansi --version --no-interaction --no-plugins --no-scripts |
| 67 | + |
| 68 | +# install default Composer dependencies |
| 69 | +RUN mkdir -p /phpAction/composer |
| 70 | +COPY composer.json /phpAction/composer |
| 71 | +RUN cd /phpAction/composer && /usr/bin/composer install --no-plugins --no-scripts --prefer-dist --no-dev -o && rm composer.lock |
| 72 | + |
| 73 | +# install proxy binary alogn with compile and launcher scripts |
| 74 | +RUN mkdir -p /phpAction/action |
| 75 | +WORKDIR /phpAction |
| 76 | +COPY --from=builder /bin/proxy /bin/proxy |
| 77 | +ADD compile /bin/compile |
| 78 | +ADD runner.php /bin/runner.php |
| 79 | +ENV OW_COMPILER=/bin/compile |
| 80 | + |
| 81 | +ENTRYPOINT [ "/bin/proxy" ] |
0 commit comments