You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
928 B

  1. # Configs of the docker images, you might have specify your own configs here.
  2. MYSQL_PASSWORD="YOUR_MYSQL_PASSWORD"
  3. MYSQL_RUN_NAME="YOUR_MYSQL_RUN_NAME"
  4. HOST_PORT="YOUR_HOST_PORT"
  5. # Replace the mysql root password in MySQL image Dockerfile.
  6. sed -i "s/THE_MYSQL_PASSWORD/$MYSQL_PASSWORD/g" images/mysql/Dockerfile
  7. # Replace the mysql root password in gogits image Dockerfile.
  8. sed -i "s/THE_MYSQL_PASSWORD/$MYSQL_PASSWORD/g" images/gogits/deploy.sh
  9. # Build the MySQL image
  10. cd images/mysql
  11. docker build -t gogs/mysql .
  12. #
  13. ## Build the gogits image
  14. cd ../gogits
  15. docker build -t gogs/gogits .
  16. #
  17. ## Run MySQL image with name
  18. docker run -d --name $MYSQL_RUN_NAME gogs/mysql
  19. #
  20. ## Run gogits image and link it to the MySQL image
  21. echo "Now we have the MySQL image(running) and gogs image, use the follow command to start gogs service:"
  22. echo -e "\033[33m docker run -i -t --link $MYSQL_RUN_NAME:db -p $HOST_PORT:3000 gogs/gogits \033[0m"