Tools, FAQ, Tutorials:
"docker container start --interactive" - Interact with Container
How to start and interact with the default command on a container using the "docker container start --interactive" command?
✍: FYIcenter.com
The "docker container start --attach --interactive" allows you to start
the default command with the hosting console attached to the TTY terminal
of the default command.
The "--interactive" option is needed, so that your console can interact with the running program.
1. Create a new container with a TTY terminal in interactive mode:
fyicenter$ docker container create --name java --tty --interactive openjdk
2. Start the container with the console attached to the TTY terminal and interact with the default command.
fyicenter$ docker container start --attach --interactive java java.util.prefs.FileSystemPreferences$1 run INFO: Created user preferences directory. | Welcome to JShell -- Version 12.0.1 | For an introduction type: /help intro jshell> 1+2; fyicenter$1 ==> 3 jshell> /exit | Goodbye
As you can see, we are able to create a container with TTY terminal to its default command "jshell" from the "openjdk" image. And we can run it interactively from the hosting console.
⇒ "docker container attach" - Attach Console
⇐ "docker container start --attach" - Attach Console
2021-10-10, ∼1759🔥, 0💬
Popular Posts:
How to create the Hello-3.0.epub package? I have all required files to create Hello-3.0.epub. To cre...
Can You Add Values to an Array without Keys in PHP? Can You Add Values to an Array with a Key? The a...
How to add request query string Parameters to my Azure API operation to make it more user friendly? ...
How to use .NET CLR Types in Azure API Policy? By default, Azure imports many basic .NET CLR (Common...
Where to find EPUB Sample Files? Here is a list of EPUB sample files collected by FYIcenter.com team...