mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-19 14:25:50 +00:00
dockerfile fixed
This commit is contained in:
parent
a042e32c2f
commit
5a2f4bd6d6
2 changed files with 3 additions and 2 deletions
|
@ -8,7 +8,7 @@ WORKDIR /app
|
|||
ARG ARTIFACT_VERSION
|
||||
|
||||
# Copy the JAR file into the image dynamically using the provided version
|
||||
COPY target/petclinic-${ARTIFACT_VERSION}.jar app.jar
|
||||
COPY target/spring-petclinic-${ARTIFACT_VERSION}.jar app.jar
|
||||
|
||||
# Expose port 80 for the application
|
||||
EXPOSE 80
|
||||
|
|
|
@ -7,6 +7,7 @@ pipeline {
|
|||
DOCKERHUB_CREDENTIALS = credentials('nalexxgd_docker_pass')
|
||||
DOCKERHUB_USERNAME = "nalexxgd"
|
||||
NEXUS_URL = 'localhost:8081'
|
||||
JAVA_HOME="/Library/Java/JavaVirtualMachines/applejdk-17.0.9.9.1.jdk//Contents/Home"
|
||||
def ARTIFACT_VERSION = sh(script: "mvn help:evaluate -Dexpression=project.version -q -DforceStdout", returnStdout: true).trim()
|
||||
|
||||
}
|
||||
|
@ -32,7 +33,7 @@ pipeline {
|
|||
stage('Build Docker Image') {
|
||||
steps {
|
||||
script {
|
||||
sh "docker build --build-arg ARTIFACT_VERSION=${ARTIFACT_VERSION} -t petclinic:${ARTIFACT_VERSION} ."
|
||||
sh "DOCKER_BUILDKIT=0 docker build --build-arg ARTIFACT_VERSION=${ARTIFACT_VERSION} -t petclinic:${ARTIFACT_VERSION} ."
|
||||
sh "docker tag petclinic:${ARTIFACT_VERSION} ${DOCKERHUB_USERNAME}/petclinic:${ARTIFACT_VERSION}"
|
||||
sh "docker login -u ${DOCKERHUB_USERNAME} -p ${DOCKERHUB_CREDENTIALS}"
|
||||
sh "docker push ${DOCKERHUB_USERNAME}/petclinic:${ARTIFACT_VERSION}"
|
||||
|
|
Loading…
Reference in a new issue