Skip to content

Instantly share code, notes, and snippets.

@mishak87
Created November 10, 2015 00:11
Show Gist options
  • Save mishak87/fae2e3dd3d18700f6d14 to your computer and use it in GitHub Desktop.
Save mishak87/fae2e3dd3d18700f6d14 to your computer and use it in GitHub Desktop.
# docker build && docker run
dbr () {
id=$(docker build . | grep 'Successfully built' | cut -d' ' -f 3)
if [ $? -ne 0 ]; then
exit 1;
fi
docker run "$id" "${@}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment