mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-20 23:05:49 +00:00
added the docker file
This commit is contained in:
parent
88a72438a5
commit
dad57dbd64
2 changed files with 23 additions and 0 deletions
14
Dockerfile
Normal file
14
Dockerfile
Normal file
|
@ -0,0 +1,14 @@
|
|||
FROM maven:3.9-eclipse-temurin-17 AS builder
|
||||
# build the java code
|
||||
COPY . /spc
|
||||
WORKDIR /spc
|
||||
RUN mvn package
|
||||
# this will create a spring petclinic jar file
|
||||
|
||||
|
||||
FROM eclipse-temurin:17-jre AS runner
|
||||
COPY --from=builder --chown=ubuntu /spc/target/spring-petclinic-3.3.0-SNAPSHOT.jar /app/spring-petclinic.jar
|
||||
USER ubuntu
|
||||
WORKDIR /app
|
||||
EXPOSE 8080
|
||||
CMD ["java", "-jar", "spring-petclinic.jar"]
|
|
@ -51,3 +51,12 @@ steps:
|
|||
inputs:
|
||||
pollingTimeoutSec: '300'
|
||||
displayName: 'Publish Quality Gate Result'
|
||||
|
||||
|
||||
- task: Docker@2
|
||||
inputs:
|
||||
containerRegistry: 'DOCKER_HUB'
|
||||
repository: 'kasinenichandu/spring-petclinic'
|
||||
command: 'buildAndPush'
|
||||
Dockerfile: '**/Dockerfile'
|
||||
tags: '$(Build.BuildId)'
|
||||
|
|
Loading…
Reference in a new issue