In the first chapter, we ran our first Hello World container to get a feel for how the containerization technology works. In this section, we are going to run a container in interactive mode. The docker run subcommand takes an image as an input and launches it as a container. You have to pass the -t and -i flags to the docker run subcommand in order to make the container interactive. The -i flag is the key driver, which makes the container interactive by grabbing the standard input (STDIN) of the container. The -t flag allocates a pseudo-TTY or a pseudo Terminal (Terminal emulator) and then assigns that to the container.
In the following example, we are going to launch an interactive container using the ubuntu:16.04 image and /bin/bash as the command:
$ sudo docker run -i -t ubuntu:16.04 /bin/bash
Since the ubuntu image has not been downloaded yet, if we use the docker pull...