1

I am following the instructions on Migrating ASP.NET MVC Applications to Windows Containers

I used

docker pull microsoft/aspnet

and it seemed to download correctly.

I am trying to follow the instruction "When you run this image in your container"

when I type

 docker run 5e

I get the following screen which seems to have locked up. enter image description here

Am I typing the right thing?

When I run

docker images 

I see that the microsoft/aspnet has tag "latest"

Another image also has the tag "latest"

If I type

docker run -it --name myapp 5e

then I see the same thing as previously but ending with the line "Service 'w3svc' was started

enter image description here

Thus it seems the -it command is helpful to making me feel like I have started the container successfully.

I can't actually get help on what "-it" does because it is not listed when I run

docker run --help

Though I understand it to mean "interactive terminal"

The phrase "run an image in a container" has me confused. Would it be more appropriate to say "Create a container from an image and run it" ?

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Kirsten
  • 15,730
  • 41
  • 179
  • 318
  • 1
    Please refer to this post https://stackoverflow.com/questions/18497688/run-a-docker-image-as-a-container This may helps you. – babygame0ver Jul 11 '17 at 16:51
  • Could you paste some lines from the picture to the post? It make it easier to find it using a search engine. – Mateusz Piotrowski Jul 11 '17 at 16:53
  • Studying https://docs.docker.com/engine/reference/run/#general-form – Kirsten Jul 11 '17 at 22:22
  • 1
    `docker run -it` is shorthand for `docker run -i -t` combining two different options: "Keep STDIN open even if not attached" and "Allocate a pseudo-tty". This is necessary if you're going to connect to a command line running in the container. An image is used to create a container. It's a template basically. Also you don't run an image in a container, that sentence is perhaps better written "When you us this image in your container". None of this explains why the image is repeating that message, but you're doing nothing wrong. – Mano Marks Jul 12 '17 at 19:42
  • @ManoMarks In the course I did I.T stood for interactive Terminal – Kirsten Jul 12 '17 at 20:43

1 Answers1

0

The Docker Docker run reference states

"The docker run command must specify an IMAGE to derive the container from"

I guess the usage of the word "derive" does imply that run creates the container if it is not there.

I think the reason the container appears locked up in my example is that the service I am starting is not a process that requires user input.

Kirsten
  • 15,730
  • 41
  • 179
  • 318