-
Notifications
You must be signed in to change notification settings - Fork 78
/
Dockerfile
30 lines (21 loc) · 1.1 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
# based on https://github.com/Azure/azure-functions-docker/blob/master/host/2.0/alpine/amd64/java.Dockerfile
ARG BASE_IMAGE=mcr.microsoft.com/azure-functions/base:2.0-alpine
FROM ${BASE_IMAGE} as runtime-image
FROM openjdk:8-jdk-alpine as jdk
RUN mkdir -p /usr/lib/jvm/java-1.8-openjdk
FROM mcr.microsoft.com/dotnet/core/runtime-deps:2.2-alpine
RUN apk add --no-cache libc6-compat libnsl && \
# workaround for https://github.com/grpc/grpc/issues/17255
ln -s /usr/lib/libnsl.so.2 /usr/lib/libnsl.so.1
ENV AzureWebJobsScriptRoot=/home/site/wwwroot \
HOME=/home \
FUNCTIONS_WORKER_RUNTIME=java
COPY --from=runtime-image [ "/azure-functions-host", "/azure-functions-host" ]
COPY --from=runtime-image [ "/workers/java", "/azure-functions-host/workers/java" ]
COPY --from=jdk /usr/lib/jvm/java-1.8-openjdk /usr/lib/jvm/java-1.8-openjdk
ENV JAVA_HOME /usr/lib/jvm/java-1.8-openjdk
# Kafka extension: Librdkafka
RUN apk update && apk add --no-cache librdkafka-dev
# Kafka extension: Adding files to /home/site/wwwroot
COPY . /home/site/wwwroot
CMD [ "/azure-functions-host/Microsoft.Azure.WebJobs.Script.WebHost" ]