From ba8afd4afadb589220411308fc8231c47e660a56 Mon Sep 17 00:00:00 2001 From: abhishek8shankar <127825992+abhishek8shankar@users.noreply.github.com> Date: Tue, 2 Apr 2024 12:37:34 +0530 Subject: [PATCH 1/6] [MOSIP-31575] Updated docker file. Signed-off-by: abhishek8shankar <127825992+abhishek8shankar@users.noreply.github.com> --- keycloak-artemis/Dockerfile | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/keycloak-artemis/Dockerfile b/keycloak-artemis/Dockerfile index d547c20a..f302da76 100644 --- a/keycloak-artemis/Dockerfile +++ b/keycloak-artemis/Dockerfile @@ -30,7 +30,19 @@ RUN chmod +x /usr/sbin/install_packages && chmod g+rwX /opt/bitnami && \ # Install required system packages and dependencies RUN . /usr/sbin/install_packages acl ca-certificates curl gzip libaio1 libc6 procps rsync tar zlib1g -USER 1001 +ARG container_user=mosip +ARG container_user_group=mosip +ARG container_user_uid=1001 +ARG container_user_gid=1001 + +# Create and set ownership for the container user +RUN groupadd -g ${container_user_gid} ${container_user_group} && \ + useradd -r -u ${container_user_uid} -g ${container_user_group} ${container_user} && \ + mkdir -p /home/${container_user} && \ + chown -R ${container_user}:${container_user} /home/${container_user} + +USER ${container_user_uid}:${container_user_gid} +WORKDIR /home/${container_user} ENTRYPOINT [ "/opt/bitnami/scripts/keycloak/entrypoint.sh" ] From 880e755cfe4f3a61316f6b828d19eb3f194f7fd9 Mon Sep 17 00:00:00 2001 From: abhishek8shankar <127825992+abhishek8shankar@users.noreply.github.com> Date: Tue, 2 Apr 2024 12:38:07 +0530 Subject: [PATCH 2/6] [MOSIP-31575] Updated docker file. Signed-off-by: abhishek8shankar <127825992+abhishek8shankar@users.noreply.github.com> --- keycloak-init/Dockerfile | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/keycloak-init/Dockerfile b/keycloak-init/Dockerfile index 53b4461c..e7ef02bd 100644 --- a/keycloak-init/Dockerfile +++ b/keycloak-init/Dockerfile @@ -11,26 +11,18 @@ LABEL build_time=${BUILD_TIME} # can be passed during Docker build as build time environment for github branch to pickup configuration from. ARG container_user=mosip - -# can be passed during Docker build as build time environment for github branch to pickup configuration from. ARG container_user_group=mosip - -# can be passed during Docker build as build time environment for github branch to pickup configuration from. ARG container_user_uid=1001 - -# can be passed during Docker build as build time environment for github branch to pickup configuration from. ARG container_user_gid=1001 -# install packages and create user -RUN apt-get -y update \ -&& groupadd -g ${container_user_gid} ${container_user_group} \ -&& useradd -u ${container_user_uid} -g ${container_user_group} -s /bin/sh -m ${container_user} - COPY requirements.txt . -RUN pip3 install -r requirements.txt -# change permissions of file inside working dir -RUN chown -R ${container_user}:${container_user} /home/${container_user} +## install packages, create user and change permissions of file inside working dir +RUN apt-get -y update \ +&& groupadd -g ${container_user_gid} ${container_user_group} \ +&& useradd -u ${container_user_uid} -g ${container_user_group} -s /bin/sh -m ${container_user} \ +&& pip3 install -r requirements.txt \ +&& chown -R ${container_user}:${container_user} /home/${container_user} # select container user for all tasks USER ${container_user_uid}:${container_user_gid} From 25c72fc73bb15fe171f530e332df38443b7fba00 Mon Sep 17 00:00:00 2001 From: abhishek8shankar <127825992+abhishek8shankar@users.noreply.github.com> Date: Tue, 2 Apr 2024 12:39:30 +0530 Subject: [PATCH 3/6] [MOSIP-31575] Update push-trigger.yml Signed-off-by: abhishek8shankar <127825992+abhishek8shankar@users.noreply.github.com> --- .github/workflows/push-trigger.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/push-trigger.yml b/.github/workflows/push-trigger.yml index c9f75851..e55266a7 100644 --- a/.github/workflows/push-trigger.yml +++ b/.github/workflows/push-trigger.yml @@ -25,15 +25,13 @@ jobs: strategy: matrix: include: - - SERVICE_LOCATION: 'keycloak-jboss' - SERVICE_NAME: 'mosip-jboss-keycloak' - SERVICE_LOCATION: 'keycloak-init' SERVICE_NAME: 'keycloak-init' - SERVICE_LOCATION: 'keycloak-artemis' SERVICE_NAME: 'mosip-artemis-keycloak' fail-fast: false name: ${{ matrix.SERVICE_NAME }} - uses: mosip/kattu/.github/workflows/docker-build.yml@master + uses: abhishek8shankar/kattu/.github/workflows/docker-build.yml@develop with: SERVICE_LOCATION: ${{ matrix.SERVICE_LOCATION }} SERVICE_NAME: ${{ matrix.SERVICE_NAME }} From 97ed5627ecb51619ebd5543a5c2d46f4ce7e9e18 Mon Sep 17 00:00:00 2001 From: abhishek8shankar <127825992+abhishek8shankar@users.noreply.github.com> Date: Tue, 2 Apr 2024 12:41:28 +0530 Subject: [PATCH 4/6] [MOSIP-31575] Updated docker file. Signed-off-by: abhishek8shankar <127825992+abhishek8shankar@users.noreply.github.com> --- keycloak-jboss/Dockerfile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/keycloak-jboss/Dockerfile b/keycloak-jboss/Dockerfile index 66d51974..f666cc22 100644 --- a/keycloak-jboss/Dockerfile +++ b/keycloak-jboss/Dockerfile @@ -20,3 +20,10 @@ ADD --chown=jboss:root ./standalone/ ./standalone RUN cp -R ./standalone/deployments/* /opt/jboss/keycloak/standalone/deployments +#ARG container_user=mosip +#ARG container_user_group=mosip +#ARG container_user_uid=1001 +#ARG container_user_gid=1001 +#WORKDIR /home/${container_user} +#RUN chown -R ${container_user}:${container_user} /home/${container_user} +#USER ${container_user_uid}:${container_user_gid} From ca1d5fdde89ff9887334e6f82401994ef366ecb5 Mon Sep 17 00:00:00 2001 From: abhishek8shankar <127825992+abhishek8shankar@users.noreply.github.com> Date: Tue, 2 Apr 2024 12:43:06 +0530 Subject: [PATCH 5/6] Update push-trigger.yml Signed-off-by: abhishek8shankar <127825992+abhishek8shankar@users.noreply.github.com> --- .github/workflows/push-trigger.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push-trigger.yml b/.github/workflows/push-trigger.yml index e55266a7..ac620f04 100644 --- a/.github/workflows/push-trigger.yml +++ b/.github/workflows/push-trigger.yml @@ -31,7 +31,7 @@ jobs: SERVICE_NAME: 'mosip-artemis-keycloak' fail-fast: false name: ${{ matrix.SERVICE_NAME }} - uses: abhishek8shankar/kattu/.github/workflows/docker-build.yml@develop + uses: mosip/kattu/.github/workflows/docker-build.yml@master with: SERVICE_LOCATION: ${{ matrix.SERVICE_LOCATION }} SERVICE_NAME: ${{ matrix.SERVICE_NAME }} From d81bd3845840f1dec4b8670f3e0af50e0fb13df1 Mon Sep 17 00:00:00 2001 From: abhishek8shankar <127825992+abhishek8shankar@users.noreply.github.com> Date: Wed, 3 Apr 2024 15:12:49 +0530 Subject: [PATCH 6/6] [MOSIP-31575] Updated docker file. Signed-off-by: abhishek8shankar <127825992+abhishek8shankar@users.noreply.github.com> --- keycloak-artemis/Dockerfile | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/keycloak-artemis/Dockerfile b/keycloak-artemis/Dockerfile index f302da76..6e89c0fe 100644 --- a/keycloak-artemis/Dockerfile +++ b/keycloak-artemis/Dockerfile @@ -30,20 +30,6 @@ RUN chmod +x /usr/sbin/install_packages && chmod g+rwX /opt/bitnami && \ # Install required system packages and dependencies RUN . /usr/sbin/install_packages acl ca-certificates curl gzip libaio1 libc6 procps rsync tar zlib1g -ARG container_user=mosip -ARG container_user_group=mosip -ARG container_user_uid=1001 -ARG container_user_gid=1001 - -# Create and set ownership for the container user -RUN groupadd -g ${container_user_gid} ${container_user_group} && \ - useradd -r -u ${container_user_uid} -g ${container_user_group} ${container_user} && \ - mkdir -p /home/${container_user} && \ - chown -R ${container_user}:${container_user} /home/${container_user} - -USER ${container_user_uid}:${container_user_gid} -WORKDIR /home/${container_user} - ENTRYPOINT [ "/opt/bitnami/scripts/keycloak/entrypoint.sh" ] CMD [ "/opt/bitnami/scripts/keycloak/run.sh" ]