download jar file wget https://referenceappslt.s3.ap-south-1.amazonaws.com/spring-petclinic-3.3.0-SNAPSHOT.jar
run the app java -jar spring-petclinic-3.3.0-SNAPSHOT.jar
Application runs on port 8080
Lets start containerizeing this application
FROM eclipse-temurin:17
LABEL project="learning"
LABEL author="khaja"
ADD https://referenceappslt.s3.ap-south-1.amazonaws.com/spring-petclinic-3.3.0-SNAPSHOT.jar /spring-petclinic-3.3.0-SNAPSHOT.jar
EXPOSE 8080
# CMD Executes when the container is started
CMD [ "java", "-jar", "/spring-petclinic-3.3.0-SNAPSHOT.jar" ]
Exercise: Image is created from the following Dockerfile. The contianer is not starting (exited state) Findout the reason
FROM eclipse-temurin:17
LABEL project="learning"
LABEL author="khaja"
USER nobody
ADD https://referenceappslt.s3.ap-south-1.amazonaws.com/spring-petclinic-3.3.0-SNAPSHOT.jar /apps/spring-petclinic-3.3.0-SNAPSHOT.jar
EXPOSE 8080
# CMD Executes when the container is started
CMD [ "java", "-jar", "/apps/spring-petclinic-3.3.0-SNAPSHOT.jar" ]