Created
March 24, 2017 23:47
-
-
Save jaytaylor/48aeb50ed75713aec8d2bdd1a384e97b to your computer and use it in GitHub Desktop.
Quick one-liner for copying a binary into a running docker container.
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
#!/bin/bash | |
set -o errexit | |
set -o pipefail | |
set -o nounset | |
cmd=nc ; cid=4fd9addc9980 ; base64 < $(command -v $cmd) > /tmp/b64 && sudo docker exec -i $cid bash -c "set -e && base64 --decode > /tmp/$cmd && chmod a+x /tmp/$cmd" < /tmp/b64 && sudo docker exec -it $cid bash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment