Skip to content

Instantly share code, notes, and snippets.

@richardgill
Last active August 29, 2015 14:05
Show Gist options
  • Save richardgill/c4b6e20fa0fcf031a344 to your computer and use it in GitHub Desktop.
Save richardgill/c4b6e20fa0fcf031a344 to your computer and use it in GitHub Desktop.
#!/bin/sh
{
echo "This script requires superuser access"
echo "You will be prompted for your password by sudo."
# clear any previous sudo permission
sudo -k
# run inside sudo
sudo sh <<SCRIPT
echo "Building docker instance"
docker build -t angular_seed .
echo "Running container"
SCRIPT
sudo docker run -v $PWD:/mount/angular_seed/ -p 9000:9000 -p 9876:9876 -p 4444:4444 -p 35729:35729 -e IP=$(hostname -I | awk '{print $1}') -i -t angular_seed bash -c "cd /mount/angular_seed/ && ln -s /tmp/node_modules . && ln -s /tmp/bower_components . && scripts/startXServerForFirefox.sh && npm install && bower install --allow-root && scripts/setupE2ETests.sh && grunt serve"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment