diff --git a/admin/admin-service/Dockerfile b/admin/admin-service/Dockerfile index 36d031d9674..e135f094966 100644 --- a/admin/admin-service/Dockerfile +++ b/admin/admin-service/Dockerfile @@ -9,56 +9,27 @@ LABEL commit_hash=${COMMIT_HASH} LABEL commit_id=${COMMIT_ID} LABEL build_time=${BUILD_TIME} -# can be passed during Docker build as build time environment for github branch to pickup configuration from. -ARG spring_config_label - -# can be passed during Docker build as build time environment for spring profiles active +# can be passed during Docker build as build time environment for github branch to pickup configuration from | spring profiles active | config server URL | glowroot and artifactory URL respectively . +ARG spring_config_label ARG active_profile - -# can be passed during Docker build as build time environment for config server URL -ARG spring_config_url - -# can be passed during Docker build as build time environment for artifactory URL +ARG spring_config_url ARG artifactory_url - -# can be passed during Docker build as build time environment for glowroot ARG is_glowroot -# environment variable to pass active profile such as DEV, QA etc at docker runtime +# environment variable to pass active profile such as DEV, QA etc at docker runtime | github branch to pickup configuration from, at docker runtime | spring configuration url, at docker runtime | glowroot, at docker runtime | artifactory url, at docker runtime and iam_adapter url, at docker runtime, respectively. ENV active_profile_env=${active_profile} - -# environment variable to pass github branch to pickup configuration from, at docker runtime ENV spring_config_label_env=${spring_config_label} - -# environment variable to pass spring configuration url, at docker runtime ENV spring_config_url_env=${spring_config_url} - ENV is_glowroot_env=${is_glowroot} - -# environment variable to pass artifactory url, at docker runtime ENV artifactory_url_env=${artifactory_url} - -# environment variable to pass iam_adapter url, at docker runtime ENV iam_adapter_url_env=${iam_adapter_url} # can be passed during Docker build as build time environment for github branch to pickup configuration from. ARG container_user=mosip - -# can be passed during Docker build as build time environment for github branch to pickup configuration from. 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=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 apt-get -y update \ -&& apt-get install -y unzip \ -&& groupadd -g ${container_user_gid} ${container_user_group} \ -&& useradd -u ${container_user_uid} -g ${container_user_group} -s /bin/sh -m ${container_user} - # set working directory for the user WORKDIR /home/${container_user} @@ -66,14 +37,17 @@ 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/admin-service-*.jar admin-service.jar -# change permissions of file inside working dir -RUN chown -R ${container_user}:${container_user} /home/${container_user} +## install packages, create user and change permissions of file inside working dir +RUN apt-get -y update \ +&& apt-get install -y unzip \ +&& groupadd -g ${container_user_gid} ${container_user_group} \ +&& useradd -u ${container_user_uid} -g ${container_user_group} -s /bin/sh -m ${container_user} \ +&& mkdir -p ${loader_path} \ +&& chown -R ${container_user}:${container_user} /home/${container_user} # select container user for all tasks USER ${container_user_uid}:${container_user_gid} @@ -90,4 +64,4 @@ CMD if [ "$is_glowroot_env" = "present" ]; then \ else \ wget -q --show-progress "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \ java -jar -Dloader.path="${loader_path_env}" -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" admin-service.jar; \ - fi \ No newline at end of file + fi diff --git a/admin/hotlist-service/Dockerfile b/admin/hotlist-service/Dockerfile index 0b3732ee5c0..d46cdb2dfa2 100644 --- a/admin/hotlist-service/Dockerfile +++ b/admin/hotlist-service/Dockerfile @@ -8,57 +8,27 @@ LABEL source=${SOURCE} LABEL commit_hash=${COMMIT_HASH} LABEL commit_id=${COMMIT_ID} LABEL build_time=${BUILD_TIME} - -# can be passed during Docker build as build time environment for github branch to pickup configuration from. -ARG spring_config_label - -# can be passed during Docker build as build time environment for spring profiles active +# can be passed during Docker build as build time environment for github branch to pickup configuration from | spring profiles active | config server URL | glowroot and artifactory URL respectively . +ARG spring_config_label ARG active_profile - -# can be passed during Docker build as build time environment for config server URL -ARG spring_config_url - -# can be passed during Docker build as build time environment for artifactory URL +ARG spring_config_url ARG artifactory_url - -# can be passed during Docker build as build time environment for glowroot ARG is_glowroot -# environment variable to pass active profile such as DEV, QA etc at docker runtime +# environment variable to pass active profile such as DEV, QA etc at docker runtime | github branch to pickup configuration from, at docker runtime | spring configuration url, at docker runtime | glowroot, at docker runtime | artifactory url, at docker runtime and iam_adapter url, at docker runtime, respectively. ENV active_profile_env=${active_profile} - -# environment variable to pass github branch to pickup configuration from, at docker runtime ENV spring_config_label_env=${spring_config_label} - -# environment variable to pass spring configuration url, at docker runtime ENV spring_config_url_env=${spring_config_url} - ENV is_glowroot_env=${is_glowroot} - -# environment variable to pass artifactory url, at docker runtime ENV artifactory_url_env=${artifactory_url} - -# environment variable to pass iam_adapter url, at docker runtime ENV iam_adapter_url_env=${iam_adapter_url} # can be passed during Docker build as build time environment for github branch to pickup configuration from. ARG container_user=mosip - -# can be passed during Docker build as build time environment for github branch to pickup configuration from. 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=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 apt-get -y update \ -&& apt-get install -y unzip \ -&& groupadd -g ${container_user_gid} ${container_user_group} \ -&& useradd -u ${container_user_uid} -g ${container_user_group} -s /bin/sh -m ${container_user} - # set working directory for the user WORKDIR /home/${container_user} @@ -66,14 +36,17 @@ 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/hotlist-service-*.jar hotlist-service.jar -# change permissions of file inside working dir -RUN chown -R ${container_user}:${container_user} /home/${container_user} +# install packages, create user and change permissions of file inside working dir +RUN apt-get -y update \ +&& apt-get install -y unzip \ +&& groupadd -g ${container_user_gid} ${container_user_group} \ +&& useradd -u ${container_user_uid} -g ${container_user_group} -s /bin/sh -m ${container_user} \ +&& mkdir -p ${loader_path} \ +&& chown -R ${container_user}:${container_user} /home/${container_user} # select container user for all tasks USER ${container_user_uid}:${container_user_gid} @@ -89,4 +62,4 @@ CMD if [ "$is_glowroot_env" = "present" ]; then \ else \ wget -q --show-progress "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \ java -jar -Dloader.path="${loader_path_env}" -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" hotlist-service.jar; \ - fi \ No newline at end of file + fi diff --git a/admin/kernel-masterdata-service/Dockerfile b/admin/kernel-masterdata-service/Dockerfile index 82d759f6eb5..773a8f9bcb7 100644 --- a/admin/kernel-masterdata-service/Dockerfile +++ b/admin/kernel-masterdata-service/Dockerfile @@ -9,51 +9,31 @@ LABEL commit_hash=${COMMIT_HASH} LABEL commit_id=${COMMIT_ID} LABEL build_time=${BUILD_TIME} -# can be passed during Docker build as build time environment for github branch to pickup configuration from. -ARG spring_config_label -# can be passed during Docker build as build time environment for spring profiles active +# can be passed during Docker build as build time environment for github branch to pickup configuration from | spring profiles active | config server URL | glowroot and artifactory URL respectively . +ARG spring_config_label ARG active_profile -# can be passed during Docker build as build time environment for config server URL -ARG spring_config_url -# can be passed during Docker build as build time environment for glowroot +ARG spring_config_url ARG is_glowroot -# can be passed during Docker build as build time environment for artifactory URL ARG artifactory_url # can be passed during Docker build as build time environment management rmi server hostname ARG management_rmi_server_hostname # can be passed during Docker build as build time environment management rmi server port ARG management_jmxremote_rmi_port -# can be passed during Docker build as build time environment for github branch to pickup configuration from. -ARG container_user=mosip # can be passed during Docker build as build time environment for github branch to pickup configuration from. +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=1001 - -# can be passed during Docker build as build time environment for github branch to pickup configuration from. ARG container_user_gid=1001 -# environment variable to pass active profile such as DEV, QA etc at docker runtime +# environment variable to pass active profile such as DEV, QA etc at docker runtime | github branch to pickup configuration from, at docker runtime | spring configuration url, at docker runtime | glowroot, at docker runtime | artifactory url, at docker runtime and iam_adapter url, at docker runtime, respectively. ENV active_profile_env=${active_profile} -# environment variable to pass github branch to pickup configuration from, at docker runtime ENV spring_config_label_env=${spring_config_label} -# environment variable to pass spring configuration url, at docker runtime ENV spring_config_url_env=${spring_config_url} -# environment variable to pass glowroot, at docker runtime ENV is_glowroot_env=${is_glowroot} -# environment variable to pass artifactory url, at docker runtime ENV artifactory_url_env=${artifactory_url} -# environment variable to pass iam_adapter url, at docker runtime ENV iam_adapter_url_env=${iam_adapter_url} -# install packages and create user -RUN apt-get -y update \ -&& apt-get install -y unzip \ -&& groupadd -g ${container_user_gid} ${container_user_group} \ -&& useradd -u ${container_user_uid} -g ${container_user_group} -s /bin/sh -m ${container_user} - # set working directory for the user WORKDIR /home/${container_user} @@ -61,14 +41,17 @@ 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/kernel-masterdata-service-*.jar kernel-masterdata-service.jar -# change permissions of file inside working dir -RUN chown -R ${container_user}:${container_user} /home/${container_user} +# install packages, create user and change permissions of file inside working dir +RUN apt-get -y update \ +&& apt-get install -y unzip \ +&& groupadd -g ${container_user_gid} ${container_user_group} \ +&& useradd -u ${container_user_uid} -g ${container_user_group} -s /bin/sh -m ${container_user} \ +&& mkdir -p ${loader_path} \ +&& chown -R ${container_user}:${container_user} /home/${container_user} # select container user for all tasks USER ${container_user_uid}:${container_user_gid} diff --git a/admin/kernel-syncdata-service/Dockerfile b/admin/kernel-syncdata-service/Dockerfile index 9e8e3f96593..e74e29aa701 100644 --- a/admin/kernel-syncdata-service/Dockerfile +++ b/admin/kernel-syncdata-service/Dockerfile @@ -9,56 +9,27 @@ LABEL commit_hash=${COMMIT_HASH} LABEL commit_id=${COMMIT_ID} LABEL build_time=${BUILD_TIME} -# can be passed during Docker build as build time environment for github branch to pickup configuration from. -ARG spring_config_label - -# can be passed during Docker build as build time environment for spring profiles active +# can be passed during Docker build as build time environment for github branch to pickup configuration from | spring profiles active | config server URL | glowroot and artifactory URL respectively . +ARG spring_config_label ARG active_profile - -# can be passed during Docker build as build time environment for config server URL -ARG spring_config_url - -# can be passed during Docker build as build time environment for glowroot +ARG spring_config_url ARG is_glowroot - -# can be passed during Docker build as build time environment for artifactory URL ARG artifactory_url -# environment variable to pass active profile such as DEV, QA etc at docker runtime +# environment variable to pass active profile such as DEV, QA etc at docker runtime | github branch to pickup configuration from, at docker runtime | spring configuration url, at docker runtime | glowroot, at docker runtime | artifactory url, at docker runtime and iam_adapter url, at docker runtime, respectively. ENV active_profile_env=${active_profile} - -# environment variable to pass github branch to pickup configuration from, at docker runtime ENV spring_config_label_env=${spring_config_label} - -# environment variable to pass spring configuration url, at docker runtime ENV spring_config_url_env=${spring_config_url} - -# environment variable to pass glowroot, at docker runtime ENV is_glowroot_env=${is_glowroot} - -# environment variable to pass artifactory url, at docker runtime ENV artifactory_url_env=${artifactory_url} -# environment variable to pass iam_adapter url, at docker runtime ENV iam_adapter_url_env=${iam_adapter_url} # can be passed during Docker build as build time environment for github branch to pickup configuration from. ARG container_user=mosip - -# can be passed during Docker build as build time environment for github branch to pickup configuration from. 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=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 apt-get -y update \ -&& apt-get install -y unzip \ -&& groupadd -g ${container_user_gid} ${container_user_group} \ -&& useradd -u ${container_user_uid} -g ${container_user_group} -s /bin/sh -m ${container_user} - # set working directory for the user WORKDIR /home/${container_user} @@ -66,14 +37,18 @@ 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/kernel-syncdata-service-*.jar kernel-syncdata-service.jar # change permissions of file inside working dir -RUN chown -R ${container_user}:${container_user} /home/${container_user} +# install packages and create user +RUN apt-get -y update \ +&& apt-get install -y unzip \ +&& groupadd -g ${container_user_gid} ${container_user_group} \ +&& useradd -u ${container_user_uid} -g ${container_user_group} -s /bin/sh -m ${container_user} \ +&& mkdir -p ${loader_path} \ +&& chown -R ${container_user}:${container_user} /home/${container_user} # select container user for all tasks USER ${container_user_uid}:${container_user_gid}