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

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


The following commit(s) were added to refs/heads/master by this push:
     new 285042f  standardize actionloop Dockerfile build logic (#40)
285042f is described below

commit 285042f52ccb3d25096708a039e52f3405fba78a
Author: David Grove <[email protected]>
AuthorDate: Mon Feb 3 20:58:39 2020 -0500

    standardize actionloop Dockerfile build logic (#40)
---
 core/ruby2.6ActionLoop/Dockerfile | 30 +++++++++++++++++++++---------
 gradle/docker.gradle              |  2 +-
 2 files changed, 22 insertions(+), 10 deletions(-)

diff --git a/core/ruby2.6ActionLoop/Dockerfile 
b/core/ruby2.6ActionLoop/Dockerfile
index f307aca..812d7d1 100644
--- a/core/ruby2.6ActionLoop/Dockerfile
+++ b/core/ruby2.6ActionLoop/Dockerfile
@@ -14,18 +14,30 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
-FROM golang:1.11 as builder
-ENV 
PROXY_SOURCE=https://github.com/apache/openwhisk-runtime-go/archive/[email protected]
-RUN curl -L "$PROXY_SOURCE" | tar xzf - \
-  && mkdir -p src/github.com/apache \
-  && mv openwhisk-runtime-go-golang1.11-1.13.0-incubating \
-     src/github.com/apache/incubator-openwhisk-runtime-go \
-  && cd src/github.com/apache/incubator-openwhisk-runtime-go/main \
-  && CGO_ENABLED=0 go build -o /bin/proxy
+
+# 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 [email protected]
+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 ruby:2.6.2-alpine3.9
+
+# select the builder to use
+ARG GO_PROXY_BUILD_FROM=release
+
 RUN mkdir -p /proxy/bin /proxy/lib /proxy/action
 WORKDIR /proxy
-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 lib/launcher.rb /proxy/lib/launcher.rb
 ADD bin/compile /proxy/bin/compile
 RUN apk update && apk add python3
diff --git a/gradle/docker.gradle b/gradle/docker.gradle
index 6ad6850..790c1e1 100644
--- a/gradle/docker.gradle
+++ b/gradle/docker.gradle
@@ -54,7 +54,7 @@ if(project.hasProperty('dockerHost')) {
 }
 
 if(project.hasProperty('dockerBuildArgs')) {
-    dockerBuildArgs.each { arg  ->
+    dockerBuildArgs.split(' ').each { arg  ->
         dockerBuildArg += ['--build-arg', arg]
     }
 }

Reply via email to