Skip to content

Instantly share code, notes, and snippets.

@qpwo
Created April 17, 2023 23:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qpwo/b1484a17ef550042ee2ceeaec5839411 to your computer and use it in GitHub Desktop.
Save qpwo/b1484a17ef550042ee2ceeaec5839411 to your computer and use it in GitHub Desktop.
pipe local stdin (or file) directly to remote docker container (spoof filename)
# If you have binary data or a large file that you need to copy directly
# from local to inside a remote docker container then you can do it like this:
echo fromlocal | ssh dockerhost 'docker exec -i mycontainer sh -c "cat - > /home/filename.txt"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment