Skip to content

Instantly share code, notes, and snippets.

@defclass
Forked from ElijahLynn/pipe_to_docker_examples
Created October 19, 2017 03:14
Show Gist options
  • Save defclass/75aa750e7d50fdf575780724919c3014 to your computer and use it in GitHub Desktop.
Save defclass/75aa750e7d50fdf575780724919c3014 to your computer and use it in GitHub Desktop.
How to pipe to `docker exec` examples
# These examples assume you have a container currently running.
# 1 Pipe from a file
sudo docker exec --interactive CONTAINER_NAME /bin/bash < the_beginning.sh | tee the_beginning_output.txt`
#2a Pipe by piping
echo "echo This is how we pipe to docker exec" | sudo docker exec --interactive CONTAINER_NAME /bin/bash -
curl --head "http://info.cern.ch/hypertext/WWW/TheProject.html"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment