You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by ra...@apache.org on 2020/01/26 10:05:02 UTC

[openwhisk-runtime-swift] branch master updated: standardize actionloop Dockerfile build idiom (#115)

This is an automated email from the ASF dual-hosted git repository.

rabbah pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openwhisk-runtime-swift.git


The following commit(s) were added to refs/heads/master by this push:
     new 11d0a2a  standardize actionloop Dockerfile build idiom (#115)
11d0a2a is described below

commit 11d0a2a604fa5d9b458bb4749ef437e15ad918af
Author: David Grove <dg...@users.noreply.github.com>
AuthorDate: Sun Jan 26 05:04:55 2020 -0500

    standardize actionloop Dockerfile build idiom (#115)
---
 core/swift42Action/Dockerfile | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/core/swift42Action/Dockerfile b/core/swift42Action/Dockerfile
index 94961d6..1e2bef1 100644
--- a/core/swift42Action/Dockerfile
+++ b/core/swift42Action/Dockerfile
@@ -14,10 +14,25 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
-FROM openwhisk/actionloop:nightly as builder
+
+# build go proxy from source
+FROM golang:1.12 AS builder_source
+RUN env CGO_ENABLED=0 go get github.com/apache/openwhisk-runtime-go/main && mv /go/bin/main /bin/proxy
+
+# or build it from a release
+FROM golang:1.12 AS builder_release
+ARG GO_PROXY_RELEASE_VERSION=1.12@1.15.0
+RUN curl -sL \
+  https://github.com/apache/openwhisk-runtime-go/archive/{$GO_PROXY_RELEASE_VERSION}.tar.gz\
+  | tar xzf -\
+  && cd openwhisk-runtime-go-*/main\
+  && GO111MODULE=on go build -o /bin/proxy
 
 FROM swift:4.2
 
+# select the builder to use
+ARG GO_PROXY_BUILD_FROM=release
+
 RUN rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update \
 	&& apt-get install -y --no-install-recommends locales python3 vim \
 	&& rm -rf /var/lib/apt/lists/* \
@@ -31,7 +46,9 @@ RUN mkdir -p /swiftAction
 WORKDIR /swiftAction
 
 
-COPY --from=builder /bin/proxy /bin/proxy
+COPY --from=builder_source /bin/proxy /bin/proxy_source
+COPY --from=builder_release /bin/proxy /bin/proxy_release
+RUN mv /bin/proxy_${GO_PROXY_BUILD_FROM} /bin/proxy
 ADD swiftbuild.py /bin/compile
 ADD swiftbuild.py.launcher.swift /bin/compile.launcher.swift
 COPY _Whisk.swift /swiftAction/Sources/