Current section
Files
Jump to
Current section
Files
scripts/docker-build
#!/usr/bin/env sh
app="$1"
tag="$2"
if [ "$app" == "" ]; then
echo "please specify app name, example: mix docker_build my-mega-app"
exit 1
fi
if [ "$tag" != "" ]; then
docker build \
--build-arg HEX_API_KEY="$HEX_API_KEY" \
--rm=false -t \
"$app" .
docker tag $app "$app:$tag"
else
branch=$(git rev-parse --abbrev-ref HEAD | cut -f2 -d"/")
branch=${branch:-master}
docker build \
--build-arg HEX_API_KEY="$HEX_API_KEY" \
--rm=false -t "$app:$branch" .
fi