Skip to content

Commit

Permalink
[MOSIP-32461] updated group5 Dockerfile (mosip#1874)
Browse files Browse the repository at this point in the history
* [MOSIP-32461] updated group5 Dockerfile

Signed-off-by: syed salman <[email protected]>

* [MOSIP-32461] updated group5 Dockerfile

Signed-off-by: syed salman <[email protected]>

---------

Signed-off-by: syed salman <[email protected]>
Signed-off-by: Sowmya Ujjappa Banakar <[email protected]>
  • Loading branch information
syedsalman3753 authored and Sowmya Ujjappa Banakar committed Jun 20, 2024
1 parent 8f4a894 commit 31ee2d3
Showing 1 changed file with 19 additions and 27 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM eclipse-temurin:21-jre-alpine
FROM mosipdev/openjdk-21-jre:latest

ARG SOURCE
ARG COMMIT_HASH
Expand All @@ -9,9 +9,6 @@ LABEL commit_hash=${COMMIT_HASH}
LABEL commit_id=${COMMIT_ID}
LABEL build_time=${BUILD_TIME}

#Uncomment below and Comment above line(i.e. FROM openjdk:8) for OS specific (e.g. Alpine OS ) docker base image
#FROM openjdk:8-jdk-alpine

# can be passed during Docker build as build time environment for github branch to pickup configuration from.
ARG spring_config_label

Expand Down Expand Up @@ -49,7 +46,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
Expand All @@ -64,41 +61,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-5

# 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.
# /home/logs

ARG stage_group_name=registration-processor-stage-group-5

ENV group_name=${stage_group_name}

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 volume to whichever storage directory you want to use for this container.
# /home/logs

# change permissions of file inside working dir
RUN chown -R ${container_user}:${container_user} /home/${container_user}
# set working directory for the user
WORKDIR ${work_dir}

# select container user for all tasks
USER ${container_user_uid}:${container_user_gid}
Expand Down

0 comments on commit 31ee2d3

Please sign in to comment.