Skip to content

Commit

Permalink
Add Dockerfile (dotnet#277)
Browse files Browse the repository at this point in the history
* Add Dockerfile
- Added Dockerfile for app
- Made the app a bit shorter
- Improved app with string interpolation usage

* Add trailing CR

* Simplify string joining
  • Loading branch information
richlander authored Sep 26, 2016
1 parent e3adae5 commit 0e19a98
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 26 deletions.
4 changes: 4 additions & 0 deletions samples/dotnetbot/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM microsoft/dotnet
COPY bin/Debug/netcoreapp1.0 app
WORKDIR app
ENTRYPOINT ["dotnet", "dotnetbot.dll"]
44 changes: 18 additions & 26 deletions samples/dotnetbot/Program.cs
Original file line number Diff line number Diff line change
@@ -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);
}

Console.WriteLine(GetBot(message));
}

public static string GetBot(string message)
{
string bot = "\n" + " " + message;
bot += @"
public static string GetBot(string message)
{
string bot = $"\n {message}";
bot += @"
__________________
\
\
Expand Down Expand Up @@ -63,9 +57,7 @@ ......... ..............
.....
";
return bot;
}
return bot;
}


}
}

0 comments on commit 0e19a98

Please sign in to comment.