|
15 | 15 | # limitations under the License. |
16 | 16 | # |
17 | 17 |
|
18 | | -FROM golang:1.12 as builder |
| 18 | +# build go proxy from source |
| 19 | +FROM golang:1.12 AS builder_source |
19 | 20 | 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 |
| 21 | + |
| 22 | +# or build it from a release |
| 23 | +FROM golang:1.12 AS builder_release |
| 24 | +ARG GO_PROXY_RELEASE_VERSION=1.12@1.15.0 |
| 25 | +RUN curl -sL \ |
| 26 | + https://github.com/apache/openwhisk-runtime-go/archive/{$GO_PROXY_RELEASE_VERSION}.tar.gz\ |
| 27 | + | tar xzf -\ |
| 28 | + && cd openwhisk-runtime-go-*/main\ |
| 29 | + && GO111MODULE=on go build -o /bin/proxy |
27 | 30 |
|
28 | 31 | FROM php:7.3.13-cli-stretch |
29 | 32 |
|
| 33 | +# select the builder to use |
| 34 | +ARG GO_PROXY_BUILD_FROM=release |
| 35 | + |
30 | 36 | # install dependencies |
31 | 37 | RUN \ |
32 | 38 | apt-get -y update && \ |
@@ -71,10 +77,12 @@ RUN mkdir -p /phpAction/composer |
71 | 77 | COPY composer.json /phpAction/composer |
72 | 78 | RUN cd /phpAction/composer && /usr/bin/composer install --no-plugins --no-scripts --prefer-dist --no-dev -o && rm composer.lock |
73 | 79 |
|
74 | | -# install proxy binary alogn with compile and launcher scripts |
| 80 | +# install proxy binary along with compile and launcher scripts |
75 | 81 | RUN mkdir -p /phpAction/action |
76 | 82 | WORKDIR /phpAction |
77 | | -COPY --from=builder /bin/proxy /bin/proxy |
| 83 | +COPY --from=builder_source /bin/proxy /bin/proxy_source |
| 84 | +COPY --from=builder_release /bin/proxy /bin/proxy_release |
| 85 | +RUN mv /bin/proxy_${GO_PROXY_BUILD_FROM} /bin/proxy |
78 | 86 | ADD compile /bin/compile |
79 | 87 | ADD runner.php /bin/runner.php |
80 | 88 | ENV OW_COMPILER=/bin/compile |
|
0 commit comments