This series records the actual combat process of learning spring-cloud-microservice-example, and analyzes the use of spring Cloud + Docker to build an end-to-end microservices architecture technology.
0. Prior to installation, the following software is required for installation.
Maven 3
Java 8
Docker
Docker Compose
My environment
Ubuntu |
16.04 |
Java |
OpenJDK 1.8.0 |
Docker |
18.03.1-ce |
Docker-compose |
1.8.0 |
1. Cloning or copying works
$ Docker Clone Https://github.com/kbastani/spring-cloud-microservice-example.git |
2. Building the Project
Running in the project root directory
$ mvn Clean Install
This step is performed for a period of time, depending on the speed of the network, so MAVEN repository and Docker libraries are best used for domestic sources.
This step will download all dependencies and compile the project. Once all the services have been built successfully, theMaven Docker plugin will automatically build all the images and save them to your local Docker regitsry.
If this step succeeds, you will see in the Command Number window at the end
3. Launch the cluster with Docker compose
Executed under the Spring-cloud-microservice-example/docker directory
$ docker-compose Up
This step will take a few minutes.
4. Check the results of the experiment
Open the browser and visit http://localhost:8761/to see Eureka Service's Dashboard
Enter in the browser address bar: Http://localhost:10000/movie can see the movie service rest API
To be Continued ...
Combat: Build microservices based on spring Cloud + Docker