Skip to content

Commit

Permalink
Added directory for additional dependencies/jars. (#330)
Browse files Browse the repository at this point in the history
  • Loading branch information
mandeepdhiman123 authored Jan 27, 2021
1 parent 5a34a29 commit 8860c9c
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 16 deletions.
21 changes: 13 additions & 8 deletions authentication/authentication-internal-service/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ ARG hsm_local_dir=hsm-client

ENV hsm_local_dir_name=${hsm_local_dir}

ARG boisdk_local_dir=biosdk-client
ARG biosdk_local_dir=biosdk-client

ENV biosdk_local_dir_name=${boisdk_local_dir}
ENV biosdk_local_dir_name=${biosdk_local_dir}

# install packages and create user
RUN apt-get -y update \
Expand All @@ -74,13 +74,18 @@ RUN apt-get -y update \
&& useradd -u ${container_user_uid} -g ${container_user_group} -s /bin/sh -m ${container_user} \
&& adduser ${container_user} sudo \
&& echo "%sudo ALL=(ALL) NOPASSWD:/home/${container_user}/${hsm_local_dir}/install.sh" >> /etc/sudoers \
&& echo "%sudo ALL=(ALL) NOPASSWD:/home/${container_user}/${boisdk_local_dir}/install.sh" >> /etc/sudoers
&& echo "%sudo ALL=(ALL) NOPASSWD:/home/${container_user}/${biosdk_local_dir}/install.sh" >> /etc/sudoers

# set working directory for the user
WORKDIR /home/${container_user}

ENV work_dir=/home/${container_user}
#ENV work_dir_env=/

ARG loader_path=${work_dir}/additional_jars/

RUN mkdir -p ${loader_path}

ENV loader_path_env=${loader_path}

ENV current_module_env=authentication-internal-service

Expand All @@ -107,11 +112,11 @@ CMD if [ "$is_glowroot_env" = "present" ]; then \
unzip glowroot.zip ; \
rm -rf glowroot.zip ; \
sed -i "s/<service_name>/${current_module_env}/g" glowroot/glowroot.properties ; \
wget -q --show-progress "${iam_adapter_url_env}" -O kernel-auth-adapter.jar; \
java -jar -Djava.security.debug=sunpkcs11 -javaagent:glowroot/glowroot.jar -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" -Dloader.path="${loader_path_env}",./kernel-auth-adapter.jar -Dfile.encoding="UTF-8" ${current_module_env}.jar ; \
wget -q --show-progress "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \
java -jar -Djava.security.debug=sunpkcs11 -javaagent:glowroot/glowroot.jar -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" -Dloader.path="${loader_path_env}" -Dfile.encoding="UTF-8" ${current_module_env}.jar ; \
else \
wget -q --show-progress "${iam_adapter_url_env}" -O kernel-auth-adapter.jar; \
java -jar -Djava.security.debug=sunpkcs11 -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" -Dloader.path="${loader_path_env}",./kernel-auth-adapter.jar -Dfile.encoding="UTF-8" ${current_module_env}.jar ; \
wget -q --show-progress "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \
java -jar -Djava.security.debug=sunpkcs11 -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" -Dloader.path="${loader_path_env}" -Dfile.encoding="UTF-8" ${current_module_env}.jar ; \
fi

#Sample docker run command:
Expand Down
12 changes: 9 additions & 3 deletions authentication/authentication-kyc-service/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ ARG hsm_local_dir=hsm-client

ENV hsm_local_dir_name=${hsm_local_dir}

ARG boisdk_local_dir=biosdk-client
ARG biosdk_local_dir=biosdk-client

ENV biosdk_local_dir_name=${boisdk_local_dir}
ENV biosdk_local_dir_name=${biosdk_local_dir}

# install packages and create user
RUN apt-get -y update \
Expand All @@ -73,13 +73,19 @@ RUN apt-get -y update \
&& useradd -u ${container_user_uid} -g ${container_user_group} -s /bin/sh -m ${container_user} \
&& adduser ${container_user} sudo \
&& echo "%sudo ALL=(ALL) NOPASSWD:/home/${container_user}/${hsm_local_dir}/install.sh" >> /etc/sudoers \
&& echo "%sudo ALL=(ALL) NOPASSWD:/home/${container_user}/${boisdk_local_dir}/install.sh" >> /etc/sudoers
&& echo "%sudo ALL=(ALL) NOPASSWD:/home/${container_user}/${biosdk_local_dir}/install.sh" >> /etc/sudoers

# set working directory for the user
WORKDIR /home/${container_user}

ENV work_dir=/home/${container_user}

ARG loader_path=${work_dir}/additional_jars/

RUN mkdir -p ${loader_path}

ENV loader_path_env=${loader_path}

ENV current_module_env=authentication-kyc-service

ADD configure_start.sh configure_start.sh
Expand Down
6 changes: 6 additions & 0 deletions authentication/authentication-otp-service/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ WORKDIR /home/${container_user}

ENV work_dir=/home/${container_user}

ARG loader_path=${work_dir}/additional_jars

RUN mkdir -p ${loader_path}

ENV loader_path_env=${loader_path}

ENV current_module_env=authentication-otp-service

ADD configure_start.sh configure_start.sh
Expand Down
12 changes: 9 additions & 3 deletions authentication/authentication-service/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ ARG hsm_local_dir=hsm-client

ENV hsm_local_dir_name=${hsm_local_dir}

ARG boisdk_local_dir=biosdk-client
ARG biosdk_local_dir=biosdk-client

ENV biosdk_local_dir_name=${boisdk_local_dir}
ENV biosdk_local_dir_name=${biosdk_local_dir}

# install packages and create user
RUN apt-get -y update \
Expand All @@ -73,13 +73,19 @@ RUN apt-get -y update \
&& useradd -u ${container_user_uid} -g ${container_user_group} -s /bin/sh -m ${container_user} \
&& adduser ${container_user} sudo \
&& echo "%sudo ALL=(ALL) NOPASSWD:/home/${container_user}/${hsm_local_dir}/install.sh" >> /etc/sudoers \
&& echo "%sudo ALL=(ALL) NOPASSWD:/home/${container_user}/${boisdk_local_dir}/install.sh" >> /etc/sudoers
&& echo "%sudo ALL=(ALL) NOPASSWD:/home/${container_user}/${biosdk_local_dir}/install.sh" >> /etc/sudoers

# set working directory for the user
WORKDIR /home/${container_user}

ENV work_dir=/home/${container_user}

ARG loader_path=${work_dir}/additional_jars/

RUN mkdir -p ${loader_path}

ENV loader_path_env=${loader_path}

ENV current_module_env=authentication-service

ADD configure_start.sh configure_start.sh
Expand Down
2 changes: 1 addition & 1 deletion docker/configure_biosdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ else
fi

echo "Attempting to install"
cd ./$DIR_NAME && chmod +x install.sh && source install.sh
cd ./$DIR_NAME && chmod +x install.sh && sudo ./install.sh
echo "Installation complete"
cd $work_dir

Expand Down
1 change: 0 additions & 1 deletion docker/configure_hsmclient.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,4 @@ cd ./$DIR_NAME && chmod +x install.sh && sudo ./install.sh
echo "Installation complete"
cd $work_dir


exec "$@"

0 comments on commit 8860c9c

Please sign in to comment.