diff --git a/commons-packet/commons-packet-service/Dockerfile b/commons-packet/commons-packet-service/Dockerfile index 366f53c7129..8a2652139a4 100644 --- a/commons-packet/commons-packet-service/Dockerfile +++ b/commons-packet/commons-packet-service/Dockerfile @@ -54,6 +54,9 @@ ENV artifactory_url_env=${artifactory_url} # environment variable to pass iam_adapter url, at docker runtime ENV iam_adapter_url_env=${iam_adapter_url} +# environment variable to pass iam_adapter url, at docker runtime +ENV cache_provider_url_env=${cache_provider_url} + # install packages and create user RUN apt-get -y update \ && apt-get install -y unzip \ @@ -63,6 +66,14 @@ RUN apt-get -y update \ # 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} + COPY ./target/commons-packet-service-*.jar commons-packet-service.jar # change permissions of file inside working dir @@ -74,15 +85,17 @@ USER ${container_user_uid}:${container_user_gid} EXPOSE 8086 CMD if [ "$is_glowroot_env" = "present" ]; then \ - wget "${artifactory_url_env}"/artifactory/libs-release-local/io/mosip/testing/glowroot.zip ; \ - wget "${iam_adapter_url_env}" -O kernel-auth-adapter.jar; \ + wget -q --show-progress "${artifactory_url_env}"/artifactory/libs-release-local/io/mosip/testing/glowroot.zip ; \ + wget -q --show-progress "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \ + wget -q --show-progress "${cache_provider_url_env}" -O "${loader_path_env}"/cache-provider.jar; \ unzip glowroot.zip ; \ rm -rf glowroot.zip ; \ sed -i 's//commons-packet-service/g' glowroot/glowroot.properties ; \ - java -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -XX:MaxRAMFraction=1 -XX:+HeapDumpOnOutOfMemoryError -XX:+UseG1GC -XX:+UseStringDeduplication -Dloader.path=./kernel-auth-adapter.jar -jar -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}" commons-packet-service.jar ; \ + java -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -XX:MaxRAMFraction=1 -XX:+HeapDumpOnOutOfMemoryError -XX:+UseG1GC -XX:+UseStringDeduplication -Dloader.path="${loader_path_env}" -jar -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}" commons-packet-service.jar ; \ else \ - wget "${iam_adapter_url_env}" -O kernel-auth-adapter.jar; \ - java -Dloader.path=./kernel-auth-adapter.jar -jar -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" commons-packet-service.jar; \ + wget -q --show-progress "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \ + wget -q --show-progress "${cache_provider_url_env}" -O "${loader_path_env}"/cache-provider.jar; \ + java -Dloader.path="${loader_path_env}" -jar -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" commons-packet-service.jar; \ fi #CMD ["java", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseCGroupMemoryLimitForHeap", "-XX:MaxRAMFraction=1", "-XX:+HeapDumpOnOutOfMemoryError", "-XX:+UseG1GC", "-XX:+UseStringDeduplication", "-jar", "-Dspring.cloud.config.label=${spring_config_label_env}","-Dspring.profiles.active=${active_profile_env}","-Dspring.cloud.config.uri=${spring_config_url_env}", "-Dcom.sun.management.jmxremote=true", "-Dcom.sun.management.jmxremote.rmi.port="${management.jmxremote.rmi.port_env}"8099" , "-Dcom.sun.management.jmxremote.port="${management.jmxremote.rmi.port_env}"", "-Dcom.sun.management.jmxremote.ssl=false" ,"-Dcom.sun.management.jmxremote.authenticate=false", "-Dcom.sun.management.jmxremote.local.only=false", "-Djava.rmi.server.hostname="${management.rmi.server.hostname_env}"" , "commons-packet-service.jar"]