Sign inSign up

msanajyv/job_sample

By msanajyv

Updated over 4 years ago

Image
0

192

msanajyv/job_sample repository overview

Job Sample

Console app to test Jobs in Kubernetes.

App just runs a loop with delay and writes contents to a file.

            Program prg = new Program();
            int x = 10;
            var path = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
            StreamWriter outputFile = new StreamWriter(Path.Combine(path + "/WriteLines.txt"));

            if (args != null && args.Length > 0)
                x = Convert.ToInt32(args[0]);

            for (int i = 0; i < x; i++)
            {
                prg.Func1(outputFile);
                prg.Func2(outputFile);
                Thread.Sleep(1000);
            }
            outputFile.Flush();
            Environment.Exit(0);

Docker file content.


FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base
WORKDIR /app

ADD publish .
ENTRYPOINT ["dotnet", "Job_Sample.dll"]

Tag summary

Content type

Image

Digest

Size

80.8 MB

Last updated

over 4 years ago

docker pull msanajyv/job_sample:1.0.0.4