14
14
# See the License for the specific language governing permissions and
15
15
# limitations under the License.
16
16
#
17
- FROM golang:1.12 as builder
17
+
18
+ # build go proxy from source
19
+ FROM golang:1.12 AS builder_source
18
20
RUN 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/[email protected]
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
+
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
26
30
27
31
FROM python:3.7-stretch
28
32
33
+ # select the builder to use
34
+ ARG GO_PROXY_BUILD_FROM=release
35
+
29
36
# Install common modules for python
30
37
RUN pip install \
31
38
beautifulsoup4==4.6.3 \
@@ -41,7 +48,9 @@ RUN pip install \
41
48
42
49
RUN mkdir -p /action
43
50
WORKDIR /
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
45
54
ADD pythonbuild.py /bin/compile
46
55
ADD pythonbuild.py.launcher.py /bin/compile.launcher.py
47
56
ENV OW_COMPILER=/bin/compile
0 commit comments