Public Repository

Last pushed: a year ago
Short Description
Full Description

This is sample project that uses

  • springboot
  • database mysql
  • docker
  • maven + java8

full source code :

First, clone the project and build locally:

git clone
cd spring-boot-docker-mysql

mvn clean package docker:build
Run MySQL 5.7 in Docker container:

docker run --name demo-mysql -e MYSQL_ROOT_PASSWORD=password -e MYSQL_DATABASE=demo -e MYSQL_USER=demo_user -e MYSQL_PASSWORD=demo_pass -p 3306:3306 -d mysql:5.7
Check the log to make sure the server is running OK:

docker logs demo-mysql
Run demo application in Docker container and link to demo-mysql:

docker run -p 8080:8080 --name web-app --link demo-mysql:mysql -d sopheamak/springboot_docker_mysql

You can check the log by

docker logs demo-app
To push the image you just built to the registry, specify the pushImage flag.

mvn clean package docker:build -DpushImage

check docker logs

docker logs dockerwar

more about docker plugin with maven :


To run this you need to install docker-compose first

cd target/docker
docker-compose up -d

Docker Pull Command