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.

27 lines
785 B

  1. # Configs
  2. MYSQL_PASSWORD="YOUR_MYSQL_PASSWORD"
  3. MYSQL_RUN_NAME="YOUR_MYSQL_RUN_NAME"
  4. typeset -u MYSQL_ALIAS
  5. MYSQL_ALIAS="YOUR_MYSQL_ALIAS"
  6. HOST_PORT="YOUR_HOST_PORT"
  7. # Replace the mysql root password in MySQL image Dockerfile.
  8. sed -i "s/THE_MYSQL_PASSWORD/$MYSQL_PASSWORD/g" images/mysql/Dockerfile
  9. # Replace the mysql root password in gogits image Dockerfile.
  10. sed -i "s/THE_MYSQL_PASSWORD/$MYSQL_PASSWORD/g" images/gogits/Dockerfile
  11. # Build the MySQL image
  12. cd images/mysql
  13. docker build -i gogs/mysql .
  14. # Build the gogits image
  15. cd images/gogits
  16. docker build -i gogs/gogits .
  17. # Run MySQL image with name
  18. docker run -d --name $MYSQL_RUN_NAME gogs/mysql
  19. # Run gogits image and link it to the MySQL image
  20. docker run --link $MYSQL_RUN_NAME:$MYSQL_ALIAS -p $HOST_PORT:3000 gogs/gogits