- Now that we have an image in our system, so let’s try to run a container:
# docker run -it ubuntu:latest /bin/bash
- We pass two command line flags: -i and -t. The -i flag keeps STDIN open from the container, even if we're not attached to it. This persistent standard input is one half of what we need for an interactive shell. The -t flag is the other half and tells Docker to assign a pseudo-tty to the container we're about to create. This provides us with an interactive shell in the new container:
- Here, you can perform entire operations, such as installing packages and running program. To get out of the container, press ...