From 7a68de9636024cda0e50f8369e8fd6959821a973 Mon Sep 17 00:00:00 2001 From: PRAFUL RAKHADE <99539100+Prafulrakhade@users.noreply.github.com> Date: Mon, 31 Jul 2023 09:55:08 +0530 Subject: [PATCH] =?UTF-8?q?[MOSIP-28241]=20Added=20build=20details=20in=20?= =?UTF-8?q?Dockerfile=20and=20docker=20build=20in=20push=5Ftr=E2=80=A6=20(?= =?UTF-8?q?#284)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [28241] Added build details in Dockerfile and docker build in push_trigger.yml file * [28241] Added build details in Dockerfile and docker build in push_trigger.yml file --- .github/workflows/push_trigger.yml | 6 ++++-- mock-abis/Dockerfile | 10 ++++++++++ mock-mv/Dockerfile | 9 +++++++++ softhsm/Dockerfile | 9 +++++++++ softhsm/artifactory/Dockerfile | 9 +++++++++ softhsm/test-client/Dockerfile | 9 +++++++++ 6 files changed, 50 insertions(+), 2 deletions(-) diff --git a/.github/workflows/push_trigger.yml b/.github/workflows/push_trigger.yml index 468099b1..63b1c006 100644 --- a/.github/workflows/push_trigger.yml +++ b/.github/workflows/push_trigger.yml @@ -59,7 +59,8 @@ jobs: run: | cd mock-abis ls -ltr ./target - docker build . --file Dockerfile --tag mock-abis + # docker build . --file Dockerfile --tag mock-abis + docker build . --build-arg SOURCE=mosip --build-arg COMMIT_HASH=$(git rev-parse HEAD) --build-arg COMMIT_ID=$(git rev-parse --short HEAD) --build-arg BUILD_TIME=${{steps.date.outputs.date}} --file Dockerfile --tag ${{ env.SERVICE_NAME }} - name: Log into registry run: echo "${{ secrets.release_docker_hub }}" | docker login -u ${{ secrets.actor_docker_hub }} --password-stdin @@ -89,7 +90,8 @@ jobs: run: | cd mock-mv ls -ltr ./target - docker build . --file Dockerfile --tag mock-mv + # docker build . --file Dockerfile --tag mock-mv + docker build . --build-arg SOURCE=mosip --build-arg COMMIT_HASH=$(git rev-parse HEAD) --build-arg COMMIT_ID=$(git rev-parse --short HEAD) --build-arg BUILD_TIME=${{steps.date.outputs.date}} --file Dockerfile --tag ${{ env.SERVICE_NAME }} - name: Log into registry run: echo "${{ secrets.release_docker_hub }}" | docker login -u ${{ secrets.actor_docker_hub }} --password-stdin diff --git a/mock-abis/Dockerfile b/mock-abis/Dockerfile index bb8ed7bc..70506e37 100644 --- a/mock-abis/Dockerfile +++ b/mock-abis/Dockerfile @@ -1,4 +1,14 @@ FROM openjdk:11 + +ARG SOURCE +ARG COMMIT_HASH +ARG COMMIT_ID +ARG BUILD_TIME +LABEL source=${SOURCE} +LABEL commit_hash=${COMMIT_HASH} +LABEL commit_id=${COMMIT_ID} +LABEL build_time=${BUILD_TIME} + # environment variable to pass github branch to pickup configuration from, at docker runtime ENV spring_config_label_env=${spring_config_label} # environment variable to pass active profile such as DEV, QA etc at docker runtime diff --git a/mock-mv/Dockerfile b/mock-mv/Dockerfile index e6f38668..064f065c 100644 --- a/mock-mv/Dockerfile +++ b/mock-mv/Dockerfile @@ -1,4 +1,13 @@ FROM openjdk:11 + +ARG SOURCE +ARG COMMIT_HASH +ARG COMMIT_ID +ARG BUILD_TIME +LABEL source=${SOURCE} +LABEL commit_hash=${COMMIT_HASH} +LABEL commit_id=${COMMIT_ID} +LABEL build_time=${BUILD_TIME} # environment variable to pass github branch to pickup configuration from, at docker runtime ENV spring_config_label_env=${spring_config_label} # environment variable to pass active profile such as DEV, QA etc at docker runtime diff --git a/softhsm/Dockerfile b/softhsm/Dockerfile index bd8503c3..5a7f31a2 100644 --- a/softhsm/Dockerfile +++ b/softhsm/Dockerfile @@ -1,4 +1,13 @@ FROM ubuntu:18.04 as buildimage + +ARG SOURCE +ARG COMMIT_HASH +ARG COMMIT_ID +ARG BUILD_TIME +LABEL source=${SOURCE} +LABEL commit_hash=${COMMIT_HASH} +LABEL commit_id=${COMMIT_ID} +LABEL build_time=${BUILD_TIME} RUN apt-get update \ && apt-get -y upgrade \ && apt-get -y install gcc make automake libtool autoconf pkg-config libssl-dev git-core \ diff --git a/softhsm/artifactory/Dockerfile b/softhsm/artifactory/Dockerfile index 6f30bccf..45d6f521 100644 --- a/softhsm/artifactory/Dockerfile +++ b/softhsm/artifactory/Dockerfile @@ -1,2 +1,11 @@ FROM nginx + +ARG SOURCE +ARG COMMIT_HASH +ARG COMMIT_ID +ARG BUILD_TIME +LABEL source=${SOURCE} +LABEL commit_hash=${COMMIT_HASH} +LABEL commit_id=${COMMIT_ID} +LABEL build_time=${BUILD_TIME} ADD client.zip /usr/share/nginx/html/artifactory/libs-release-local/hsm/client.zip \ No newline at end of file diff --git a/softhsm/test-client/Dockerfile b/softhsm/test-client/Dockerfile index 00e50786..ae45024b 100644 --- a/softhsm/test-client/Dockerfile +++ b/softhsm/test-client/Dockerfile @@ -1,4 +1,13 @@ FROM openjdk:8 + +ARG SOURCE +ARG COMMIT_HASH +ARG COMMIT_ID +ARG BUILD_TIME +LABEL source=${SOURCE} +LABEL commit_hash=${COMMIT_HASH} +LABEL commit_id=${COMMIT_ID} +LABEL build_time=${BUILD_TIME} RUN apt-get update \ && apt-get -y upgrade \ && apt-get -y install unzip