Created
April 17, 2017 14:07
-
-
Save enil/33e3ced4eff0699e043efc0830db7a3b to your computer and use it in GitHub Desktop.
Build and run a temporary Docker image contained in a shell script
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/sh | |
TAG=$(uuidgen | tr -d '-' | tr '[A-Z]' '[a-z]') | |
docker build -t $TAG - << EOF | |
FROM debian | |
ENTRYPOINT ["echo", "Hello world from ${TAG}!"] | |
EOF | |
docker run --rm $TAG | |
docker rmi $TAG |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment