2

I'm a docker newbie. I have a web api dotnet core application (the default one).

I'm running on windows 7 with the docker toolbox.

I've configured my machine with all the ENV vars and when I run the application via visual studio, I see that the docker image is created and the container runs and everything's cool.

Now I want to be a little detached from visual studio and I start using docker from the command line.

I take the current running container, stop it, start it again, it says that it is started under a new port, but then I try hitting the new url in my browser and I get nothing. It seems like no server is hosting my application.

Here's the cmd commands I write:

docker stop containername
docker start containername
docker  inspect --format="{{json .NetworkSettings.Ports}}" <containerId>

And this is the response:

{"80/tcp":[{"HostIp":"0.0.0.0","HostPort":"32781"}]}

I've tried to look at the output of the visual studio (during the build) but I couldn't find what I'm missing.

So, how can I restart a container that was built via visual studio and make it "work"? What's the command I'm missing?

Amir Popovich
  • 29,350
  • 9
  • 53
  • 99

0 Answers0