-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
38 lines (24 loc) · 1.33 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
FROM vmware/photon2:20180424
RUN tdnf install -yq tar gzip apache-maven-3.5.0-5.ph2 && curl -f https://cdn.azul.com/zulu/bin/zulu10.1+11-jdk10-linux_x64.tar.gz | tar -xzf -
ENV PATH=/zulu10.1+11-jdk10-linux_x64/bin:${PATH}
ENV PATH /var/opt/apache-maven/bin:$PATH
ARG IMAGE_TEMPLATE=/image-template
ARG FUNCTION_TEMPLATE=/function-template
ARG servers=1
LABEL io.dispatchframework.imageTemplate="${IMAGE_TEMPLATE}" \
io.dispatchframework.functionTemplate="${FUNCTION_TEMPLATE}"
COPY image-template ${IMAGE_TEMPLATE}/
COPY function-template ${FUNCTION_TEMPLATE}/
RUN cp ${IMAGE_TEMPLATE}/empty-pom.xml /root
COPY validator /validator/
COPY function-server /function-server/
WORKDIR /function-server
RUN mvn install && cd cp-gen && mvn dependency:build-classpath -Dmdep.outputFile=../cp.txt
ENV WORKDIR=/function PORT=8080 SERVERS=$servers FUNKY_VERSION=0.1.2
EXPOSE ${PORT}
WORKDIR ${WORKDIR}
RUN curl -L https://github.com/dispatchframework/funky/releases/download/${FUNKY_VERSION}/funky${FUNKY_VERSION}.linux-amd64.tgz -o funky${FUNKY_VERSION}.linux-amd64.tgz
RUN tar -xzf funky${FUNKY_VERSION}.linux-amd64.tgz
# OpenFaaS readiness check depends on this file
RUN touch /tmp/.lock
CMD SERVER_CMD="java -cp target/classes:$(<./cp.txt):$(</function-server/cp.txt) io.dispatchframework.javabaseimage.Entrypoint $(cat /tmp/handler)" ./funky