Skip to content

Instantly share code, notes, and snippets.

@yurifrl
Created August 24, 2016 00:41
Show Gist options
  • Save yurifrl/d9d0f9c811328a1f31ba26b21e86580d to your computer and use it in GitHub Desktop.
Save yurifrl/d9d0f9c811328a1f31ba26b21e86580d to your computer and use it in GitHub Desktop.
basic-docker.sh
#!/bin/bash
# Use deploy directory as working directory
parent_path=$( cd "$(dirname "${BASH_SOURCE}")" ; pwd -P )
cd "$parent_path"
# halt on any error
# set -e
build() {
docker build -t pomodoro-slack ..
}
run() {
docker run --rm -ti \
-e ENV=development \
-v $(pwd):/app \
-w /app \
-p 80:80 \
pomodoro-slack "$@"
}
bash() {
run bash
}
continue() {
read -p "Press [Enter] key to continue..." key
}
while :
do
clear
echo "---------------------------------"
echo " M A I N - M E N U"
echo "---------------------------------"
echo '1. build'
echo '2. bash'
echo '0. exit'
echo "---------------------------------"
read -r -p "Enter your choice: " option
case ${option} in
1) build
continue;;
2) bash
continue;;
0) break;;
esac
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment