diff --git a/registration-processor/stage-groups/registration-processor-stage-group-2/Dockerfile b/registration-processor/stage-groups/registration-processor-stage-group-2/Dockerfile index 7c2b62d3858..a0764cc0545 100644 --- a/registration-processor/stage-groups/registration-processor-stage-group-2/Dockerfile +++ b/registration-processor/stage-groups/registration-processor-stage-group-2/Dockerfile @@ -1,4 +1,4 @@ -FROM eclipse-temurin:21-jre-alpine +FROM mosipdev/openjdk-21-jre:latest ARG SOURCE ARG COMMIT_HASH @@ -49,7 +49,7 @@ ARG container_user=mosip 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=1002 +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 @@ -64,41 +64,36 @@ ENV biosdk_local_dir_name=${biosdk_local_dir} #ENV bio_sdk_folder_env=${bio_sdk_folder} ENV biosdk_zip_file_path=${biosdk_zip_path} -# install packages and create user -RUN apk -q update \ -&& apk add -q unzip sudo \ -&& addgroup -g ${container_user_gid} ${container_user_group} \ -&& adduser -s /bin/sh -u ${container_user_uid} -G ${container_user_group} -h /home/${container_user} --disabled-password ${container_user} \ -&& addgroup sudo \ -&& adduser ${container_user} sudo \ -&& echo "%sudo ALL=(ALL) NOPASSWD:/home/${container_user}/${biosdk_local_dir}/install.sh" >> /etc/sudoers +ARG stage_group_name=registration-processor-stage-group-2 -# set working directory for the user -WORKDIR /home/${container_user} +ENV group_name=${stage_group_name} ENV work_dir=/home/${container_user} ARG loader_path=${work_dir}/additional_jars/ -RUN mkdir -p ${loader_path} - ENV loader_path_env=${loader_path} -# change volume to whichever storage directory you want to use for this container. -#VOLUME /home/logs - -ARG stage_group_name=registration-processor-stage-group-2 - -ENV group_name=${stage_group_name} +# set working directory for the user +WORKDIR ${work_dir} ADD ./target/${group_name}-*.jar ${group_name}.jar ADD configure_start.sh configure_start.sh -RUN chmod +x configure_start.sh +# install packages and create user +RUN apt-get -y update \ +&& apt-get install -y unzip sudo \ +&& groupadd -g ${container_user_gid} ${container_user_group} \ +&& useradd -u ${container_user_uid} -g ${container_user_group} -s /bin/bash -m ${container_user} \ +&& adduser ${container_user} sudo \ +&& echo "%sudo ALL=(ALL) NOPASSWD:/home/${container_user}/${biosdk_local_dir}/install.sh" >> /etc/sudoers \ +&& mkdir -p ${loader_path} \ +&& chmod +x configure_start.sh \ +&& chown -R ${container_user}:${container_user} ${work_dir} -# change permissions of file inside working dir -RUN chown -R ${container_user}:${container_user} /home/${container_user} +# change volume to whichever storage directory you want to use for this container. +#VOLUME /home/logs # select container user for all tasks USER ${container_user_uid}:${container_user_gid} diff --git a/registration-processor/stage-groups/registration-processor-stage-group-4/Dockerfile b/registration-processor/stage-groups/registration-processor-stage-group-4/Dockerfile index 51bc297ca8b..2e76d664c8d 100644 --- a/registration-processor/stage-groups/registration-processor-stage-group-4/Dockerfile +++ b/registration-processor/stage-groups/registration-processor-stage-group-4/Dockerfile @@ -1,4 +1,4 @@ -FROM eclipse-temurin:21-jre-alpine +FROM mosipdev/openjdk-21-jre:latest ARG SOURCE ARG COMMIT_HASH @@ -64,41 +64,36 @@ ENV biosdk_local_dir_name=${biosdk_local_dir} #ENV bio_sdk_folder_env=${bio_sdk_folder} ENV biosdk_zip_file_path=${biosdk_zip_path} -# install packages and create user -RUN apk -q update \ -&& apk add -q unzip sudo \ -&& addgroup -g ${container_user_gid} ${container_user_group} \ -&& adduser -s /bin/sh -u ${container_user_uid} -G ${container_user_group} -h /home/${container_user} --disabled-password ${container_user} \ -&& addgroup sudo \ -&& adduser ${container_user} sudo \ -&& echo "%sudo ALL=(ALL) NOPASSWD:/home/${container_user}/${biosdk_local_dir}/install.sh" >> /etc/sudoers +ARG stage_group_name=registration-processor-stage-group-4 -# set working directory for the user -WORKDIR /home/${container_user} +ENV group_name=${stage_group_name} ENV work_dir=/home/${container_user} ARG loader_path=${work_dir}/additional_jars/ -RUN mkdir -p ${loader_path} - ENV loader_path_env=${loader_path} -# change volume to whichever storage directory you want to use for this container. -#VOLUME /home/logs - -ARG stage_group_name=registration-processor-stage-group-4 - -ENV group_name=${stage_group_name} +# set working directory for the user +WORKDIR ${work_dir} ADD ./target/${group_name}-*.jar ${group_name}.jar ADD configure_start.sh configure_start.sh -RUN chmod +x configure_start.sh +# install packages and create user +RUN apt-get -y update \ +&& apt-get install -y unzip sudo \ +&& groupadd -g ${container_user_gid} ${container_user_group} \ +&& useradd -u ${container_user_uid} -g ${container_user_group} -s /bin/bash -m ${container_user} \ +&& adduser ${container_user} sudo \ +&& echo "%sudo ALL=(ALL) NOPASSWD:/home/${container_user}/${biosdk_local_dir}/install.sh" >> /etc/sudoers \ +&& mkdir -p ${loader_path} \ +&& chmod +x configure_start.sh \ +&& chown -R ${container_user}:${container_user} ${work_dir} -# change permissions of file inside working dir -RUN chown -R ${container_user}:${container_user} /home/${container_user} +# change volume to whichever storage directory you want to use for this container. +#VOLUME /home/logs # select container user for all tasks USER ${container_user_uid}:${container_user_gid}