Skip to content
This repository has been archived by the owner on Nov 6, 2023. It is now read-only.

Added reason to use -it flag #572

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions beginner/chapters/alpine.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ $ docker run alpine /bin/sh

Wait, nothing happened! Is that a bug? Well, no. These interactive shells will exit after running any scripted commands, unless they are run in an interactive terminal - so for this example to not exit, you need to `docker run -it alpine /bin/sh`.

Notice the `-it` flag in this modified command. The flag `-i` tells docker daemon to start an iterative session and `-t` command tells docker to attach the terminal of container to the current terminal.
Sandeep-source marked this conversation as resolved.
Show resolved Hide resolved

You are now inside the container shell and you can try out a few commands like `ls -l`, `uname -a` and others. Exit out of the container by giving the `exit` command.


Expand Down