1
0
mirror of synced 2025-12-19 18:06:02 -05:00

Add Dockerfile (#277)

* Add Dockerfile
- Added Dockerfile for app
- Made the app a bit shorter
- Improved app with string interpolation usage

* Add trailing CR

* Simplify string joining
This commit is contained in:
Rich Lander
2016-09-26 08:51:01 -07:00
committed by GitHub
parent e3adae5105
commit 0e19a98c5f
2 changed files with 22 additions and 26 deletions

View File

@@ -0,0 +1,4 @@
FROM microsoft/dotnet
COPY bin/Debug/netcoreapp1.0 app
WORKDIR app
ENTRYPOINT ["dotnet", "dotnetbot.dll"]

View File

@@ -1,29 +1,23 @@
using System;
namespace DotnetBot
public static class Program
{
public static class Program
{
public static void Main(string[] args)
{
string message = "";
if (args.Length < 1)
{
message = "Welcome to .NET Core!";
} else
{
foreach (string item in args)
{
message += item;
}
}
Console.WriteLine(GetBot(message));
}
public static void Main(string[] args)
{
string message = "Dotnet-bot: Welcome to using .NET Core!";
if (args.Length > 0)
{
message = String.Join(" ",args);
}
public static string GetBot(string message)
{
string bot = "\n" + " " + message;
bot += @"
Console.WriteLine(GetBot(message));
}
public static string GetBot(string message)
{
string bot = $"\n {message}";
bot += @"
__________________
\
\
@@ -63,9 +57,7 @@ namespace DotnetBot
.....
";
return bot;
}
return bot;
}
}
}