summaryrefslogtreecommitdiffstats
path: root/scripts/dockerfiles/run.sh
diff options
context:
space:
mode:
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 0000000000..cef2ebb81f
--- /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
+