1414# See the License for the specific language governing permissions and
1515# limitations under the License.
1616#
17- FROM golang:1.12 as builder
17+
18+ # build go proxy from source
19+ FROM golang:1.12 AS builder_source
1820RUN env CGO_ENABLED=0 go get github.com/apache/openwhisk-runtime-go/main && mv /go/bin/main /bin/proxy
19- # ENV PROXY_SOURCE=https://github.com/apache/openwhisk-runtime-go/archive/golang1.11@1.13.0-incubating.tar.gz
20- # RUN curl -L "$PROXY_SOURCE" | tar xzf - \
21- # && mkdir -p src/github.com/apache \
22- # && mv openwhisk-runtime-go-golang1.11-1.13.0-incubating \
23- # src/github.com/apache/incubator-openwhisk-runtime-go \
24- # && cd src/github.com/apache/incubator-openwhisk-runtime-go/main \
25- # && 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
2630
2731FROM python:3.7-stretch
2832
33+ # select the builder to use
34+ ARG GO_PROXY_BUILD_FROM=release
35+
2936# Install common modules for python
3037RUN pip install \
3138 beautifulsoup4==4.6.3 \
@@ -41,7 +48,9 @@ RUN pip install \
4148
4249RUN mkdir -p /action
4350WORKDIR /
44- COPY --from=builder /bin/proxy /bin/proxy
51+ COPY --from=builder_source /bin/proxy /bin/proxy_source
52+ COPY --from=builder_release /bin/proxy /bin/proxy_release
53+ RUN mv /bin/proxy_${GO_PROXY_BUILD_FROM} /bin/proxy
4554ADD pythonbuild.py /bin/compile
4655ADD pythonbuild.py.launcher.py /bin/compile.launcher.py
4756ENV OW_COMPILER=/bin/compile
0 commit comments