Skip to content

Instantly share code, notes, and snippets.

@alloy-d
Created February 10, 2015 20:30
Show Gist options
  • Save alloy-d/db1c653a43890b577f87 to your computer and use it in GitHub Desktop.
Save alloy-d/db1c653a43890b577f87 to your computer and use it in GitHub Desktop.
Build multiple docker images using the same Ansible directory as build context.
#!/bin/sh
if [ "$1" = "" ]; then
echo "Please specify the name of an image in the images directory."
fi
DIR="images/${1}"
if [ ! -d "$DIR" ]; then
echo "${DIR} doesn't exist!"
echo "Please specify the name of an image in the images directory."
exit 1
fi
tar -c . -C "$DIR" . | docker build -t "overturemedia/${1}" -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment