From the course: Learning Docker
Unlock the full course today
Join today to access over 23,200 courses taught by industry experts.
Saving data from containers - Docker Tutorial
From the course: Learning Docker
Saving data from containers
- [Instructor] Containers are meant to be disposable. When they're deleted, they're deleted for good. This includes any data you've saved within them. Let me show you an example. I'm going to use Docker run --rm to create and immediately remove a simple Ubuntu container. I'm going to use --entrypoint to tell Docker that I want to run a shell command. Then I'm going to provide the name of the image, ubuntu. Then at the end of this command, I'm going to send the text, Hello there., to a file called /tmp/file with the echo command and print it with the cat command. I'm going to use a couple of arguments to make this work, and there it is. All right, let's give this a try. As we can see, it went and created that file and printed Hello there. to our screen. Now let's see what happens when I try to print this file on my computer. Oh no! Our system said no. Everything you create within a container stays within the…
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
-
-
-
-