From the course: Learning Docker
Unlock the full course today
Join today to access over 24,400 courses taught by industry experts.
Create a Docker container: The short way - Docker Tutorial
From the course: Learning Docker
Create a Docker container: The short way
- [Instructor] Previously we looked at the long way of creating and starting Docker containers. Let's get the short way a try. It would be really inconvenient if we had to create and start containers explicitly every time we wanted to run our app. It would also be inconvenient to have to use Docker ps to know whether our app ran successfully and then use Docker logs to see its output. Fortunately, Docker created a single command that rolls all these steps into one. That command is Docker Run. Let's try running it against our Hello World Docker image from before. To do that, I'm going to just type docker run hello-world, and again, since I want the Linux version for demo purposes, I'll type :linux. That was so much faster. As we can see here, docker run automatically created a container from the hello world image, started it, and attached to the container to show us its output immediately. Another way to think about…
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
-
-
-
-