Jump to content

Can't run container in docker


Recommended Posts

I have task to run container (on my azure vm - linux) from nahidupa/crash:latest image and before fix all the problems.
So when i try to run container i have error

~$ docker run -it nahidupa/crash:latest
Unhandled exception. System.IO.FileNotFoundException: Could not find file '/c:\notes.txt'.
File name: '/c:\notes.txt'
   at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
   at System.IO.FileStream.OpenHandle(FileMode mode, FileShare share, FileOptions options)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
   at System.IO.StreamReader.ValidateArgsAndOpenPath(String path, Encoding encoding, Int32 bufferSize)
   at System.IO.StreamReader..ctor(String path, Encoding encoding)
   at System.IO.File.ReadLines(String path)
   at crash.Program.Main(String[] args) in /Users/nahidul/RiderProjects/crash/crash/Program.cs:line 9

I tried to connect to container interactively and have this files

root@8075cccbb894:/# ls
Dockerfile  bin   crash.csproj  etc   lib    media  notes.txt  opt   root  sbin  sys  usr
Program.cs  boot  dev           home  lib64  mnt    obj        proc  run   srv   tmp  var

nano Program.cs

   using System;

namespace crash
{
    class Program
    {
        static void Main(string[] args)
        {
            System.IO.File.ReadLines("c:\\notes.txt");
        }
    }
}

made changes in this file but dont know what to do next.
I dont have a lot experience in docker so maybe you can help me.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...