Learn about building a Docker image from the Dockerfile.
- [Instructor] Okay, now that we have a Dockerfile,…we're going to want to build an image from it…so that we can spin up containers from that image.…The way we do this is with the Docker Build command.…We want to make sure that we're in the directory…where Dockerfile is in our PowerShell command line.…From the command line, type docker build dash t,…and the t is for tagging the image to give it a name.…In this case, we're going to call it conference api.…
And the last argument is the dot.…That means that we're going to be looking…for a Dockerfile, capital D, no extension,…in the current directory to build this image from.…Now I have the Microsoft ASP NET Core build image…and the Microsoft ASP NET Core image…already downloaded onto my host.…If you don't, this build is going to take…quite a bit longer.…It's stepping through the Dockerfile one step at a time.…It's going to build the build image…and then eventually the published image.…
At the bottom you'll see a security warning…that tells me I'm building a Linux Docker image…
- Why containers?
- How do containers compare to virtual machines?
- Creating a Dockerfile
- Building an image from a Dockerfile
- Running a container from a new image
- Working with the Docker Compose file format
- Pushing images to Docker Hub