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:01:58 UTC
[openwhisk-runtime-rust] branch master updated: standarize
actionloop Dockerfile build logic (#19)
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-rust.git
The following commit(s) were added to refs/heads/master by this push:
new 8b7af15 standarize actionloop Dockerfile build logic (#19)
8b7af15 is described below
commit 8b7af159194443c52b10ba847021f289075a3dd0
Author: David Grove <dg...@users.noreply.github.com>
AuthorDate: Sun Jan 26 05:01:49 2020 -0500
standarize actionloop Dockerfile build logic (#19)
---
gradle/docker.gradle | 2 +-
rust1.34/Dockerfile | 31 ++++++++++++++++++++++---------
2 files changed, 23 insertions(+), 10 deletions(-)
diff --git a/gradle/docker.gradle b/gradle/docker.gradle
index 6ad6850..790c1e1 100755
--- 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]
}
}
diff --git a/rust1.34/Dockerfile b/rust1.34/Dockerfile
index 7a15785..b523c9d 100644
--- a/rust1.34/Dockerfile
+++ b/rust1.34/Dockerfile
@@ -14,16 +14,29 @@
# 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/golang1.11@1.13.0-incubating.tar.gz
-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 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 rust:1.34
-COPY --from=builder /bin/proxy /bin/proxy
+
+# select the builder to use
+ARG GO_PROXY_BUILD_FROM=release
+
+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
+
RUN mkdir -p /action
ADD compile /bin/compile
ADD src /usr/src