diff options
author | Unknown <joe2010xtmf@163.com> | 2014-04-11 12:16:17 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-04-11 12:16:17 -0400 |
commit | b26df298651018f5787a545c765856aed1cf94e4 (patch) | |
tree | 13a53b99bccbc1e4096b1639cad504d956c8bb03 /dockerfiles/build.sh | |
parent | 23e318f85a912d84c5621eb0a8e09465bf37a3cb (diff) | |
parent | 0650c3c9f609ba833c29fa120a34f15c0f064b54 (diff) |
Merge branch 'master' of github.com:gogits/gogs into dev
Diffstat (limited to 'dockerfiles/build.sh')
-rwxr-xr-x | dockerfiles/build.sh | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/dockerfiles/build.sh b/dockerfiles/build.sh new file mode 100755 index 00000000..1e7cf0ad --- /dev/null +++ b/dockerfiles/build.sh @@ -0,0 +1,25 @@ +# Configs of the docker images, you might have specify your own configs here. +MYSQL_PASSWORD="YOUR_MYSQL_PASSWORD" +MYSQL_RUN_NAME="YOUR_MYSQL_RUN_NAME" +HOST_PORT="YOUR_HOST_PORT" + +# Replace the mysql root password in MySQL image Dockerfile. +sed -i "s/THE_MYSQL_PASSWORD/$MYSQL_PASSWORD/g" images/mysql/Dockerfile +# Replace the mysql root password in gogits image Dockerfile. +sed -i "s/THE_MYSQL_PASSWORD/$MYSQL_PASSWORD/g" images/gogits/deploy.sh + +# Build the MySQL image +cd images/mysql +docker build -t gogs/mysql . +# +## Build the gogits image +cd ../gogits +docker build -t gogs/gogits . +# +## Run MySQL image with name +docker run -d --name $MYSQL_RUN_NAME gogs/mysql +# +## Run gogits image and link it to the MySQL image +echo "Now we have the MySQL image(running) and gogs image, use the follow command to start gogs service:" +echo -e "\033[33m docker run -i -t --link $MYSQL_RUN_NAME:db -p $HOST_PORT:3000 gogs/gogits \033[0m" + |