It’s time to get hands-on with Docker. In this chapter you’ll get 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, running simple commands to get a feel for this new way of working with applications.
Let’s get started with Docker the same way we would with any new computing concept: running Hello World. You have Docker up and running from chapter 1, so open your favorite terminal--that could be Terminal on the Mac or a Bash shell on Linux, and I recommend 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.
Try it now:
docker container run diamol/ch02-hello-diamol
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.