From 0b5f76cc3e6780348034f8444e9bd18ddce2735f Mon Sep 17 00:00:00 2001 From: Sandeep Kushwaha <61611561+Sandeep-source@users.noreply.github.com> Date: Mon, 22 Aug 2022 09:12:21 +0530 Subject: [PATCH 1/3] Added reason to use -it flag Line number #54 does not clarify what we have changed in the new command to make the container to run the command interactively. It would make more sense to the beginners if we tell them how the following command differs from the previous one and what makes the container interactive. --- beginner/chapters/alpine.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/beginner/chapters/alpine.md b/beginner/chapters/alpine.md index 9022f7094d..f12147ed53 100644 --- a/beginner/chapters/alpine.md +++ b/beginner/chapters/alpine.md @@ -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. + 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. From be223d91fdbac285bbdd7dbf150d70f001657c5d Mon Sep 17 00:00:00 2001 From: Sandeep Kushwaha Date: Tue, 6 Dec 2022 14:51:36 +0530 Subject: [PATCH 2/3] Update beginner/chapters/alpine.md Co-authored-by: andrzejsydor --- beginner/chapters/alpine.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beginner/chapters/alpine.md b/beginner/chapters/alpine.md index f12147ed53..44cc3b8671 100644 --- a/beginner/chapters/alpine.md +++ b/beginner/chapters/alpine.md @@ -53,7 +53,7 @@ $ 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. +Notice the `-it` flag in this modified command. The flag `-i` tells docker daemon to start an interactive session and `-t` command tells docker to attach the terminal of the container to the current terminal. 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. From 01273c8bea12dfca6cfb9151481acb2ef82b54ff Mon Sep 17 00:00:00 2001 From: Sandeep Kushwaha Date: Thu, 29 Dec 2022 16:24:26 +0530 Subject: [PATCH 3/3] Update beginner/chapters/alpine.md Co-authored-by: andrzejsydor --- beginner/chapters/alpine.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beginner/chapters/alpine.md b/beginner/chapters/alpine.md index 44cc3b8671..538db4f8a1 100644 --- a/beginner/chapters/alpine.md +++ b/beginner/chapters/alpine.md @@ -53,7 +53,7 @@ $ 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 interactive session and `-t` command tells docker to attach the terminal of the container to the current terminal. +Notice the `-it` flag in this modified command. The flag `-i` tells the Docker daemon to start an interactive session, and `-t` command tells the Docker to attach the terminal of the container to the current terminal. 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.