Last active
April 26, 2021 17:38
-
-
Save lflucasferreira/02938b8b314be4614e711232a9388c6a to your computer and use it in GitHub Desktop.
Docker Exec Xargs
This file contains hidden or 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
export DOCKER_HOST=127.0.0.1 |
This file contains hidden or 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
$ docker start alpine | xargs -I{} bash -c 'docker exec -it {} sh' | |
# xargs executes command on a new child process. | |
# So you need to reopen STDIN to child process for interactive communication. (MacOS: -o option) | |
$ docker start alpine | xargs -I{} -o docker exec -it {} sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment