Answers: <p>The first thing you'll want to do is look for errors.  It sounds like you have a Dockerfile that is creating an image, but when you run the image it appears to not do anything.  There are two immediate things you can do to troubleshoot this:</p>
  
  <ol>
  <li>Do not use the -d flag when running the image.  This flag runs the container in detached mode and will not display container output to the console.</li>
  <li>Examine the <a href="https://docs.docker.com/engine/reference/commandline/logs/" rel="nofollow noreferrer">logs</a> from the container.  Even though the container does not appear to be running, it is most likely crashing on start.  You can verify this by using <code>docker ps -a</code> which will show you all containers (including ones that have stopped due to crashes).</li>
  </ol>
  
  <p>Once you know what the error is you can look at whether this is a problem with your startup script or the Dockerfile.  Based on what you've described so far this sounds like you could be missing files in the right location, or the <a href="https://docs.docker.com/engine/reference/builder/#entrypoint" rel="nofollow noreferrer">Entrypoint</a> or <a href="https://docs.docker.com/engine/reference/builder/#cmd" rel="nofollow noreferrer">CMD</a> is incorrect.</p>
  
Answers: CC BY-SA 4.0
Answers: 2019-09-18T14:00:44.237Z
Answers: 2019-09-18T14:00:44.237Z
Answers: Wesley Rolnick
Answers: <p>Review the containers' output in your terminal. If it was run in detached mode (with <code>-d</code> flag) then the you can review its output using <code>docker container logs &lt;container name&gt;</code>.</p>
  
  <p>If the container doesn't behave as planned but also doesn't exit, you may want to diagnose parts of your application from inside the container. You can do this by creating an interactive shell inside it with the command: <code>docker container exec -it &lt;container name&gt; sh</code>.</p>
  
  <p>Another way to interact with the container's file system would be to mount some of its content on the host machine, then you will have it available to any tools you might want to use from your machine. This can be done by adding the option <code>-v /path/on/host:/path/in/container</code> when running the image.</p>
  
  <p>For a more focused answer, it will help if you provide an example of what Error or behavior occurs.
  Good luck!</p>
  
Answers: CC BY-SA 4.0
Answers: 2019-09-24T07:51:16.130Z
Answers: 2019-09-24T07:51:16.130Z
Answers: maze
Body: <p>Starting with Docker for Windows and C# applications.</p>
  
  <p>I've been able to do some basic building and running of dockerfiles. However, I've run into the first application that doesn't run right out of the gate, and am uncertain how I would begin to troubleshoot it.</p>
  
  <p>What are some of the techniques used when moving an app into a container (Windows image) for the first time? </p>
  
Tags: <docker>
Title: Developing in Docker for Windows Basics
UserDisplayName: James McLellan
ThreadText: # Developing in Docker for Windows Basics
  
  (Asked by: username_0 on 2019-09-18)
  
  Starting with Docker for Windows and C# applications.
  
  I've been able to do some basic building and running of dockerfiles. However, I've run into the first application that doesn't run right out of the gate, and am uncertain how I would begin to troubleshoot it.
  
  What are some of the techniques used when moving an app into a container (Windows image) for the first time?
  
  **Tags:** docker
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2019-09-18. Score: 2
  
  The first thing you'll want to do is look for errors. It sounds like you have a Dockerfile that is creating an image, but when you run the image it appears to not do anything. There are two immediate things you can do to troubleshoot this:
  
  1. Do not use the -d flag when running the image. This flag runs the container in detached mode and will not display container output to the console.
  2. Examine the [logs](https://docs.docker.com/engine/reference/commandline/logs/) from the container. Even though the container does not appear to be running, it is most likely crashing on start. You can verify this by using `docker ps -a` which will show you all containers (including ones that have stopped due to crashes).
  
  Once you know what the error is you can look at whether this is a problem with your startup script or the Dockerfile. Based on what you've described so far this sounds like you could be missing files in the right location, or the [Entrypoint](https://docs.docker.com/engine/reference/builder/#entrypoint) or [CMD](https://docs.docker.com/engine/reference/builder/#cmd) is incorrect.
  
  
  ---
  
  ### Answer by username_2 on 2019-09-24. Score: 0
  
  Review the containers' output in your terminal. If it was run in detached mode (with `-d` flag) then the you can review its output using `docker container logs <container name>`.
  
  If the container doesn't behave as planned but also doesn't exit, you may want to diagnose parts of your application from inside the container. You can do this by creating an interactive shell inside it with the command: `docker container exec -it <container name> sh`.
  
  Another way to interact with the container's file system would be to mount some of its content on the host machine, then you will have it available to any tools you might want to use from your machine. This can be done by adding the option `-v /path/on/host:/path/in/container` when running the image.
  
  For a more focused answer, it will help if you provide an example of what Error or behavior occurs.
  Good luck!
  
  
  ---
  
  