Tools, FAQ, Tutorials:
"docker container create --tty" - TeleTYpewriter Terminal
How to create a new container with a TTY (TeleTYpewriter) terminal with "docker container create --tty" command?
✍: FYIcenter.com
The "docker container create --tty --interactive" allows you to create a new container
with a TTY (TeleTYpewriter) terminal, so that you can attach a console
when it is running.
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 start --attach" - Attach Console
⇐ "docker container create --name" - Name Container
2023-03-17, 1683🔥, 0💬
Popular Posts:
How To Convert a Character to an ASCII Value? If you want to convert characters to ASCII values, you...
How to use the urllib.request.Request object to build more complex HTTP request? The urllib.request....
How to Instantiate Chaincode on BYFN Channel? You can follow this tutorial to Instantiate Chaincode ...
How to send an FTP request with the urllib.request.urlopen() function? If an FTP server supports ano...
What is EPUB 2.0 Metadata "dc:publisher" and "dc:rights" elements? EPUB 2.0 Metadata "dc:publisher" ...