Created
August 9, 2019 19:53
-
-
Save rimelek/38f261fe9ffb409327c0e2ab4003b97e to your computer and use it in GitHub Desktop.
Test attaching to a docker container's standard input
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu | |
CMD bash -c 'echo -n "Type your name: " && read name && echo -n "Your name is " && echo $name && sleep 4' | |
# Test commands: | |
# docker build -t attachtest . | |
# docker run -d -it --name attachtest-container attachtest | |
# docker attach attachtest-container | |
# docker rm -f attachtest-container | |
# # Output should be the name you typed | |
# # Now remove the test container | |
# docker rm -f attachtest-container |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment