2 Understanding Docker and running Hello World
It’s time to get hands-on with Docker, in order to gain lots of experience with the core feature of Docker: running applications in containers. I’ll also cover some background that will help you understand exactly what a container is, and why containers are such a lightweight way to run apps. Mostly you’ll be following Try It Now exercises and running simple commands to get a feel for this new way of working with applications.
2.1 Running Hello World in a container
Let’s get started with Docker the same way we would with any new computing concept: by running Hello World. You installed Docker in chapter 1, so now you should start Docker Desktop and open your favorite terminal—that could be Terminal on the Mac or a Bash shell on Linux, and you should use PowerShell in Windows.
You’re going to send a command to Docker, telling it to run a container that prints out some simple “Hello, World” text.
When we’re done with this chapter, you’ll understand exactly what’s happening here. For now, just take a look at the output. It will be something like figure 2.1.
Figure 2.1 The output from running the Hello World container. You can see Docker downloading the application package (called an image), running the app in a container, and showing the output.
