mirror of
https://github.com/openfaas/faas.git
synced 2025-06-09 00:36:46 +00:00
dotnet Core example
This commit is contained in:
parent
c3bbec09c1
commit
b69bca09a3
@ -11,4 +11,5 @@ Each one will read the request from the watchdog then print it back resulting in
|
|||||||
| Golang | functions/base:golang-1.7.5-alpine | Golang compiled on Alpine Linux |
|
| Golang | functions/base:golang-1.7.5-alpine | Golang compiled on Alpine Linux |
|
||||||
| Python | functions/base:python-2.7-alpine | Python 2.7 built on Alpine Linux |
|
| Python | functions/base:python-2.7-alpine | Python 2.7 built on Alpine Linux |
|
||||||
| Java | functions/base:openjdk-8u121-jdk-alpine | OpenJDK built on Alpine Linux |
|
| Java | functions/base:openjdk-8u121-jdk-alpine | OpenJDK built on Alpine Linux |
|
||||||
|
| Dotnet Core | functions/base:dotnet-sdk | Microsoft dotnet core SDK |
|
||||||
| Busybox / shell | functions/alpine:latest | Busybox contains useful binaries which can be turned into a FaaS function such as `sha512sum` or `cat` |
|
| Busybox / shell | functions/alpine:latest | Busybox contains useful binaries which can be turned into a FaaS function such as `sha512sum` or `cat` |
|
||||||
|
16
sample-functions/BaseFunctions/dncore/Dockerfile
Normal file
16
sample-functions/BaseFunctions/dncore/Dockerfile
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
FROM microsoft/dotnet:sdk
|
||||||
|
|
||||||
|
ADD https://github.com/alexellis/faas/releases/download/v0.5-alpha/fwatchdog /usr/bin
|
||||||
|
RUN chmod +x /usr/bin/fwatchdog
|
||||||
|
|
||||||
|
ENV DOTNET_CLI_TELEMETRY_OPTOUT 1
|
||||||
|
|
||||||
|
WORKDIR /root/
|
||||||
|
COPY src src
|
||||||
|
WORKDIR /root/src
|
||||||
|
RUN dotnet restore
|
||||||
|
RUN dotnet build
|
||||||
|
|
||||||
|
ENV fprocess="dotnet ./bin/Debug/netcoreapp1.1/root.dll"
|
||||||
|
EXPOSE 8080
|
||||||
|
CMD ["fwatchdog"]
|
5
sample-functions/BaseFunctions/dncore/src/.gitignore
vendored
Normal file
5
sample-functions/BaseFunctions/dncore/src/.gitignore
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
bin/
|
||||||
|
obj/
|
||||||
|
.nuget/
|
||||||
|
.dotnet/
|
||||||
|
.templateengine/
|
25
sample-functions/BaseFunctions/dncore/src/Program.cs
Normal file
25
sample-functions/BaseFunctions/dncore/src/Program.cs
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
using System;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace root
|
||||||
|
{
|
||||||
|
class Program
|
||||||
|
{
|
||||||
|
private static string getStdin() {
|
||||||
|
StringBuilder buffer = new StringBuilder();
|
||||||
|
string s;
|
||||||
|
while ((s = Console.ReadLine()) != null)
|
||||||
|
{
|
||||||
|
buffer.AppendLine(s);
|
||||||
|
}
|
||||||
|
return buffer.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Main(string[] args)
|
||||||
|
{
|
||||||
|
string buffer = getStdin();
|
||||||
|
|
||||||
|
Console.WriteLine(buffer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
8
sample-functions/BaseFunctions/dncore/src/root.csproj
Executable file
8
sample-functions/BaseFunctions/dncore/src/root.csproj
Executable file
@ -0,0 +1,8 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<OutputType>Exe</OutputType>
|
||||||
|
<TargetFramework>netcoreapp1.1</TargetFramework>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
</Project>
|
Loading…
x
Reference in New Issue
Block a user