More About Docker Run

In this lesson, you will further explore the 'docker run' command by running the 'alpine' image.

You can think of the docker run command as the equivalent of buying a new computer, executing some command on it, then throwing it away. Each time a container is created from an image, you get a new isolated and virgin environment to play with inside that container.

What you get inside the container depends on which image your container is based on. After the image name, you can pass the commands you want to execute inside the container.

Let’s illustrate the new-computer-that-you-trash metaphor using the alpine image. The alpine image is a very small Linux image that does enough for our purpose.

Let’s run a container and ask it to display its hostname.

Get hands-on with 1000+ tech skills courses.