Skip to content

Instantly share code, notes, and snippets.

@panggi
Created March 8, 2016 10:20
Show Gist options
  • Select an option

  • Save panggi/cf68fcf43689ee134292 to your computer and use it in GitHub Desktop.

Select an option

Save panggi/cf68fcf43689ee134292 to your computer and use it in GitHub Desktop.
script to create docker image with option to accept environment variable
#!/bin/bash
envs=(development staging sandbox production)
for i in "${envs[@]}"
do
if [ "$1" == "$i" ]
then
grunt $1
if [ "$1" != 'development' ]
then
gulp
fi
docker build --build-arg NODE=$1 -t username/project .
docker images
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment