From the course: Deploying ASP.NET Core Applications
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Test the Docker image locally
From the course: Deploying ASP.NET Core Applications
Test the Docker image locally
- [Instructor] Now that we've built an image with Docker build, we can test it on our local machine. First use Docker images to list the images that are available, hellocoreworld is the name of the image I created before. I can run this image using Docker run. I'll use the -it flag to tell Docker to take all of the output from the container and pipe it to this console window. I'll also use the -p flag to map port 5000 from inside of the container, which was exposed with the expose command in the Docker file, to port 5000 on this machine, on my local machine. And finally I'll specify the name of the image that I want to spin up. When I hit enter, Docker will take this image, create a container from it, and then run the container and show me the output. And it works really fast, so in just that amount of time I have the container spun up, Kestrel started up, and it's listening for requests. If I switch over to a browser and browse to localhost5000, I should start interacting with that…
Contents
-
-
-
-
-
-
-
-
(Locked)
Docker overview2m 7s
-
(Locked)
Create a Docker image3m 31s
-
(Locked)
Test the Docker image locally1m 14s
-
(Locked)
Run and monitor a container1m 22s
-
(Locked)
Docker Compose overview50s
-
(Locked)
Kestrel and NGINX with Compose4m 6s
-
(Locked)
Save an image to a file1m 2s
-
(Locked)
Publish an image to Docker Hub1m 37s
-
(Locked)
-