diff --git a/biosdk-services/Dockerfile b/biosdk-services/Dockerfile index e02c0bb..23c753a 100644 --- a/biosdk-services/Dockerfile +++ b/biosdk-services/Dockerfile @@ -1,4 +1,4 @@ -FROM eclipse-temurin:21-jre-alpine +FROM mosipdev/openjdk-21-jre:latest # label to be assigned along with Docker build [Mandatory] ARG SOURCE @@ -50,17 +50,11 @@ 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 -# install packages and create user -RUN apk -q update \ -&& apk add -q unzip wget libstdc++ libc++-dev libjpeg-turbo-dev libpng-dev libwebp-dev tiff-dev openblas-dev ffmpeg-dev gfortran 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} - # set working directory for the user WORKDIR /home/${container_user} @@ -68,36 +62,35 @@ ENV work_dir=/home/${container_user} ARG loader_path=${work_dir}/additional_jars/ -RUN mkdir -p ${loader_path} - ENV loader_path_env=${loader_path} -ADD configure_biosdk.sh /home/${container_user}/configure_biosdk.sh - -RUN chmod +x /home/${container_user}/configure_biosdk.sh - -RUN chmod a-w /home/${container_user}/configure_biosdk.sh - ARG logging_level_root=INFO ENV logging_level_root_env=${logging_level_root} -ADD ./target/biosdk-services-*.jar biosdk-services.jar +# install packages and create user for ubunutu latest +RUN apt-get update && \ + apt-get install -y --no-install-recommends sudo && \ + groupadd -g ${container_user_gid} ${container_user_group} && \ + useradd -u ${container_user_uid} -g ${container_user_group} -s /bin/bash -m ${container_user} && \ + mkdir -p /home/${container_user} ${loader_path} + -RUN chmod 775 biosdk-services.jar +ADD configure_biosdk.sh /home/${container_user}/configure_biosdk.sh -# change permissions of file inside working dir -RUN chown -R ${container_user}:${container_user} /home/${container_user} +ADD ./target/biosdk-services-*.jar biosdk-services.jar + +RUN chmod +x /home/${container_user}/configure_biosdk.sh \ + && chmod a-w /home/${container_user}/configure_biosdk.sh \ + && chmod 775 biosdk-services.jar \ + && chown -R ${container_user}:${container_user} /home/${container_user} # select container user for all tasks USER ${container_user_uid}:${container_user_gid} EXPOSE 9099 -# Set the environment variable for OpenCV native library path -ENV LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH - -ENTRYPOINT ["/home/mosip/configure_biosdk.sh"] +ENTRYPOINT ["./configure_biosdk.sh"] CMD echo $biosdk_bioapi_impl ; \ -java -Dloader.path="${loader_path_env}" -Dserver.servlet.context-path="${service_context_env}" -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" --add-modules=ALL-SYSTEM --add-opens java.xml/jdk.xml.internal=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.lang.stream=ALL-UNNAMED --add-opens java.base/java.time=ALL-UNNAMED --add-opens java.base/java.time.LocalDate=ALL-UNNAMED --add-opens java.base/java.time.LocalDateTime=ALL-UNNAMED --add-opens java.base/java.time.LocalDateTime.date=ALL-UNNAMED --add-opens java.base/jdk.internal.reflect.DirectMethodHandleAccessor=ALL-UNNAMED -jar biosdk-services.jar +java -Dloader.path="${loader_path_env}" -Dserver.servlet.context-path="${service_context_env}" -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" --add-modules=ALL-SYSTEM --add-opens java.xml/jdk.xml.internal=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.lang.stream=ALL-UNNAMED --add-opens java.base/java.time=ALL-UNNAMED --add-opens java.base/java.time.LocalDate=ALL-UNNAMED --add-opens java.base/java.time.LocalDateTime=ALL-UNNAMED --add-opens java.base/java.time.LocalDateTime.date=ALL-UNNAMED --add-opens java.base/jdk.internal.reflect.DirectMethodHandleAccessor=ALL-UNNAMED -jar biosdk-services.jar \ No newline at end of file