Skip to content

Commit 8b7af15

Browse files
dgrove-ossrabbah
authored andcommitted
standarize actionloop Dockerfile build logic (#19)
1 parent bf57b18 commit 8b7af15

File tree

2 files changed

+23
-10
lines changed

2 files changed

+23
-10
lines changed

gradle/docker.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ if(project.hasProperty('dockerHost')) {
5454
}
5555

5656
if(project.hasProperty('dockerBuildArgs')) {
57-
dockerBuildArgs.each { arg ->
57+
dockerBuildArgs.split(' ').each { arg ->
5858
dockerBuildArg += ['--build-arg', arg]
5959
}
6060
}

rust1.34/Dockerfile

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,29 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616
#
17-
FROM golang:1.11 as builder
18-
ENV PROXY_SOURCE=https://github.com/apache/openwhisk-runtime-go/archive/golang1.11@1.13.0-incubating.tar.gz
19-
RUN curl -L "$PROXY_SOURCE" | tar xzf - \
20-
&& mkdir -p src/github.com/apache \
21-
&& mv openwhisk-runtime-go-golang1.11-1.13.0-incubating \
22-
src/github.com/apache/incubator-openwhisk-runtime-go \
23-
&& cd src/github.com/apache/incubator-openwhisk-runtime-go/main \
24-
&& CGO_ENABLED=0 go build -o /bin/proxy
17+
18+
# build go proxy from source
19+
FROM golang:1.12 AS builder_source
20+
RUN env CGO_ENABLED=0 go get github.com/apache/openwhisk-runtime-go/main && mv /go/bin/main /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
30+
2531
FROM rust:1.34
26-
COPY --from=builder /bin/proxy /bin/proxy
32+
33+
# select the builder to use
34+
ARG GO_PROXY_BUILD_FROM=release
35+
36+
COPY --from=builder_source /bin/proxy /bin/proxy_source
37+
COPY --from=builder_release /bin/proxy /bin/proxy_release
38+
RUN mv /bin/proxy_${GO_PROXY_BUILD_FROM} /bin/proxy
39+
2740
RUN mkdir -p /action
2841
ADD compile /bin/compile
2942
ADD src /usr/src

0 commit comments

Comments
 (0)