Skip to content

Instantly share code, notes, and snippets.

@amogram
Created April 5, 2018 20:49
Show Gist options
  • Save amogram/bb095153606af2d79b5e2ddc1086c0f7 to your computer and use it in GitHub Desktop.
Save amogram/bb095153606af2d79b5e2ddc1086c0f7 to your computer and use it in GitHub Desktop.
DockerFile for OpenFaas .NET Core functions on Kubernetes Raspberry Pi/ARM Deployments
FROM microsoft/dotnet:2.0-sdk as builder
ENV DOTNET_CLI_TELEMETRY_OPTOUT 1
# Optimize for Docker builder caching by adding projects first.
RUN mkdir -p /root/src/function
WORKDIR /root/src/function
COPY ./function/Function.csproj .
WORKDIR /root/src/
COPY ./root.csproj .
RUN dotnet restore ./root.csproj
COPY . .
RUN dotnet publish -c release -o published -r linux-arm
ADD https://github.com/openfaas/faas/releases/download/0.6.1/fwatchdog-armhf /usr/bin/fwatchdog
RUN chmod +x /usr/bin/fwatchdog
FROM microsoft/dotnet:2.0.0-runtime-stretch-arm32v7
WORKDIR /root/
COPY --from=builder /root/src/published .
COPY --from=builder /usr/bin/fwatchdog /
ENV fprocess="dotnet ./root.dll"
EXPOSE 8080
CMD ["/fwatchdog"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment