diff --git a/Dockerfile.native b/Dockerfile.native new file mode 100644 index 0000000000000000000000000000000000000000..874a2c77e504853b4bbe92e6006ad9c590589298 --- /dev/null +++ b/Dockerfile.native @@ -0,0 +1,27 @@ +#### +# This Dockerfile is used in order to build a container that runs the Quarkus application in native (no JVM) mode. +# +# Before building the container image run: +# +# ./mvnw package -Pnative +# +# Then, build the image with: +# +# docker build -f src/main/docker/Dockerfile.native -t quarkus/user-manager . +# +# Then run the container using: +# +# docker run -i --rm -p 8080:8080 quarkus/user-manager +# +### +FROM registry.access.redhat.com/ubi8/ubi-minimal:8.5 +WORKDIR /work/ +RUN chown 1001 /work \ + && chmod "g+rwX" /work \ + && chown 1001:root /work +COPY --chown=1001:root target/*-runner /work/application + +EXPOSE 8080 +USER 1001 + +CMD ["./application", "-Dquarkus.http.host=0.0.0.0"] diff --git a/Jenkinsfile b/Jenkinsfile index 6c16d92517e9042274989bcd9946d9b034beeb2d..b752c3f24475116d0bed1ec54880b05c43368759 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -72,7 +72,7 @@ pipeline { } } - stage('Build image') { + stage('Build image') { steps { script { FAILED_STAGE=env.STAGE_NAME @@ -81,13 +81,13 @@ pipeline { withCredentials([usernamePassword(credentialsId: 'jenkins-docker-login', usernameVariable: 'USER', passwordVariable: 'PASSWORD')]) { sh 'docker login docker.ozg-sh.de -u ${USER} -p ${PASSWORD}' - sh 'docker build -f src/main/docker/Dockerfile.jvm -t docker.ozg-sh.de/user-manager:build-latest .' + sh 'docker build -f Dockerfile.native -t docker.ozg-sh.de/user-manager:build-latest .' } } } } } - + stage('Push Docker image') { steps { script { @@ -151,7 +151,7 @@ pipeline { failure { script { if (env.BRANCH_NAME == 'master' || env.BRANCH_NAME == 'release') { - sendFailureMessage() + //sendFailureMessage() } } }