Skip to content

Instantly share code, notes, and snippets.



Last active Aug 29, 2015
What would you like to do?
Given a git repository with a `Dockerfile`, this runs the given command within the container in the context of your repository.
#!/usr/bin/env bash -e
if [[ -z "$1" ]]
echo "Please specify a command to run inside the container."
exit 1
IMAGE=`git rev-parse HEAD`
docker build -t $IMAGE .
docker run --rm -v `pwd`:${WORKSPACE} ${IMAGE} ${WORKSPACE}/${COMMAND}
docker rmi $IMAGE

This comment has been minimized.

Copy link
Owner Author

@gtramontina gtramontina commented Apr 7, 2015

To run:

curl -Ls | bash -s <YOUR_COMMAND>

(the url is just a short for the raw file)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.