|
14 | 14 | # See the License for the specific language governing permissions and
|
15 | 15 | # limitations under the License.
|
16 | 16 | #
|
17 |
| -FROM golang:1.11 as builder |
18 |
| -ENV PROXY_SOURCE=https://github.com/apache/openwhisk-runtime-go/archive/golang1.11@1.13.0-incubating.tar.gz |
19 |
| -RUN curl -L "$PROXY_SOURCE" | tar xzf - \ |
20 |
| - && mkdir -p src/github.com/apache \ |
21 |
| - && mv openwhisk-runtime-go-golang1.11-1.13.0-incubating \ |
22 |
| - src/github.com/apache/incubator-openwhisk-runtime-go \ |
23 |
| - && cd src/github.com/apache/incubator-openwhisk-runtime-go/main \ |
24 |
| - && CGO_ENABLED=0 go build -o /bin/proxy |
| 17 | + |
| 18 | +# build go proxy from source |
| 19 | +FROM golang:1.12 AS builder_source |
| 20 | +RUN env CGO_ENABLED=0 go get github.com/apache/openwhisk-runtime-go/main && mv /go/bin/main /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 |
| 30 | + |
25 | 31 | FROM rust:1.34
|
26 |
| -COPY --from=builder /bin/proxy /bin/proxy |
| 32 | + |
| 33 | +# select the builder to use |
| 34 | +ARG GO_PROXY_BUILD_FROM=release |
| 35 | + |
| 36 | +COPY --from=builder_source /bin/proxy /bin/proxy_source |
| 37 | +COPY --from=builder_release /bin/proxy /bin/proxy_release |
| 38 | +RUN mv /bin/proxy_${GO_PROXY_BUILD_FROM} /bin/proxy |
| 39 | + |
27 | 40 | RUN mkdir -p /action
|
28 | 41 | ADD compile /bin/compile
|
29 | 42 | ADD src /usr/src
|
|
0 commit comments