From the course: Learning Docker
Unlock the full course today
Join today to access over 24,000 courses taught by industry experts.
Create a Docker container from Dockerfiles, part 2 - Docker Tutorial
From the course: Learning Docker
Create a Docker container from Dockerfiles, part 2
- [Instructor] Now that we've seen an example Dockerfile, let's turn it into a Docker image and start our container from it. We're going to use the docker build command to do this. Let's look at its help documentation first. Just like docker run, we have lots of options to choose from. For this example though, the only option that we'll need is the tag option. Just like containers, every Docker image has an ID. This option associates a convenient name with that ID. This way, we don't have to remember the image ID whenever we use it. So going back to our docker build command, let's call it our-first-image to keep things simple. Dockerfile looks for a file called Dockerfile by default. Since this is what our dockerfile is actually called, we don't need to change anything. However, if our Dockerfile were called something else like say app.Dockerfile, we would need to provide the dash f or dash dash file options as well so…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
Exploring the Docker CLI3m 1s
-
(Locked)
Create a Docker container6m 58s
-
(Locked)
Create a Docker container: The short way2m 9s
-
(Locked)
Create a Docker container from Dockerfiles, part 12m 46s
-
(Locked)
Create a Docker container from Dockerfiles, part 22m 37s
-
(Locked)
Interact with your container5m 9s
-
(Locked)
Stopping and removing the container5m 41s
-
(Locked)
Binding ports to your container4m 36s
-
(Locked)
Saving data from containers5m 39s
-
(Locked)
Introducing the Docker Hub1m 23s
-
(Locked)
Pushing images to the Docker registry3m 13s
-
(Locked)
Checking your images in Docker Hub2m 44s
-
(Locked)
Challenge: Starting NGINX1m 16s
-
(Locked)
Solution: Starting NGINX5m 18s
-
-
-
-