PetClinic is a Spring Boot application built using Maven and packaged as a Docker image.
This project is based on the spring-petclinic project by spring-projects.
Please refer to the original repository for more details.
- JDK 8
- Maven 3.6.0 or later
- Docker 18.0 or later
git clone https://github.com/tidharm/spring-petclinic.git
cd spring-petclinic
mvn clean package dockerfile:build
docker run -d --name petclinic -p 8080:8080 tidharm/spring-petclinic:2.4.5
You can then access petclinic here: http://localhost:8080/
(Source: spring-projects/spring-petclini)
NOTE: The PetClinic application expects HTTP access over port 8080. The above
docker runcommand shows how to map port 8080 on your host into port 8080 inside the container.
If port 8080 is already taken on your host, you can choose any other port by modifying the-pargument:
docker run -d --name petclinic -p 9999:8080 tidharm/spring-petclinic:2.4.5
- Create a new Jenkins pipeline
- In the General section, check
GitHub projectand specify the Project urlhttps://github.com/tidharm/spring-petclinic.git/ - Optional: In the Build Triggers section, check
GitHub hook trigger for GITScm pollingto trigger the build on every push. - In the Pipeline section:
- Click the Definition dropdown box and select
Pipeline script from SCM - Click the SCM dropdown box and select
Git - Under Repositories, enter the Repository URL
https://github.com/tidharm/spring-petclinic.git - Under Credentials enter (or add) your GitHub credentials set
- Under Branches to build, enter the BRanch Specifier
*/main - Under Script Path, enter
Jenkinsfile(the Jenkinsfile is located in the repository root)
- Click the Definition dropdown box and select
- Click Save
Depending on your setup, the tidharm/spring-petclinic image will be stored in the root of your Jenkins pipeline workspace.
File naming convention:
Linux: tidharm-spring-petclinic-2.4.5.tar.gz
Windows: tidharm_spring-petclinic_2.4.5.tar.gz
The Spring PetClinic sample application is released under version 2.0 of the Apache License.

