From 73c2df35c4f0cbdcd03edf189729f9a23e741f71 Mon Sep 17 00:00:00 2001 From: shubhadaR Date: Wed, 14 Dec 2022 16:12:57 +0530 Subject: [PATCH] Install git package --- .github/workflows/main.yml | 2 +- Dockerfile | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ca62b6c..5a7a41d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -178,7 +178,7 @@ jobs: # mvn install - name: Docker build run: | - docker build . -t shubhadainfra/cicd_infracloud:1 + docker build --build-arg FOO=${{ steps.build_and_test.outputs.build_number }} . -t shubhadainfra/cicd_infracloud:1 - uses: docker/login-action@v1 with: username: ${{ secrets.DOCKERHUB_USERNAME }} diff --git a/Dockerfile b/Dockerfile index 5357c04..d748b6e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,6 @@ FROM openjdk:8-jre -ARG version -COPY target/hello-world-maven-0.2.*.jar /home/myjar.jar +ARG FOO=${FOO} + +ENV FOO=${FOO} +COPY target/hello-world-maven-0.2.$FOO.jar /home/myjar.jar CMD ["java","-jar","/home/myjar.jar"] \ No newline at end of file