aboutsummaryrefslogtreecommitdiff
path: root/scripts/dockerfiles/run.sh
diff options
context:
space:
mode:
authorJustin Nuß <nuss.justin@gmail.com>2014-07-26 11:23:58 +0200
committerJustin Nuß <nuss.justin@gmail.com>2014-07-26 11:23:58 +0200
commit91480f3791f266369c343c539f8eeec245fa969a (patch)
treea03ad6062fe4b546367cdb6f9921399458d97441 /scripts/dockerfiles/run.sh
parent835e85b5ce9921ffd4d50b90b706e02685167331 (diff)
parent35c75f06a0a4f321021984830d760e67ca0ef8e5 (diff)
Merge branch 'dev' of https://github.com/gogits/Gogs into issue/281
Conflicts: modules/base/tool.go
Diffstat (limited to 'scripts/dockerfiles/run.sh')
-rwxr-xr-xscripts/dockerfiles/run.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/scripts/dockerfiles/run.sh b/scripts/dockerfiles/run.sh
new file mode 100755
index 00000000..cef2ebb8
--- /dev/null
+++ b/scripts/dockerfiles/run.sh
@@ -0,0 +1,19 @@
+# Configs
+MYSQL_PASSWORD="kuajie8402"
+MYSQL_RUN_NAME="gogs_mysql"
+typeset -u MYSQL_ALIAS
+MYSQL_ALIAS="db"
+HOST_PORT="3000"
+
+DOCKER_BIN=$(which docker.io || which docker)
+if [ -z "$DOCKER_BIN" ] ; then
+ echo "Please install docker. You can install docker by running \"wget -qO- https://get.docker.io/ | sh\"."
+ exit 1
+fi
+
+## Run MySQL image with name
+$DOCKER_BIN run -d --name $MYSQL_RUN_NAME gogs/mysql
+#
+## Run gogits image and link it to the MySQL image
+$DOCKER_BIN run --link $MYSQL_RUN_NAME:$MYSQL_ALIAS -p $HOST_PORT:3000 gogs/gogits
+