Skip to content

Commit f6fba22

Browse files
dgrove-ossrabbah
authored andcommitted
standardize actionloop Dockerfile build steps (#81)
1 parent 0b15eff commit f6fba22

File tree

2 files changed

+19
-10
lines changed

2 files changed

+19
-10
lines changed

core/pythonActionLoop/Dockerfile

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,25 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616
#
17-
FROM golang:1.12 as builder
17+
18+
# build go proxy from source
19+
FROM golang:1.12 AS builder_source
1820
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
2630

2731
FROM python:3.7-stretch
2832

33+
# select the builder to use
34+
ARG GO_PROXY_BUILD_FROM=release
35+
2936
# Install common modules for python
3037
RUN pip install \
3138
beautifulsoup4==4.6.3 \
@@ -41,7 +48,9 @@ RUN pip install \
4148

4249
RUN mkdir -p /action
4350
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
4554
ADD pythonbuild.py /bin/compile
4655
ADD pythonbuild.py.launcher.py /bin/compile.launcher.py
4756
ENV OW_COMPILER=/bin/compile

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
}

0 commit comments

Comments
 (0)