Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MOSIP-31575] Updated docker file. #310

Merged
merged 2 commits into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 10 additions & 41 deletions admin-ui/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,10 @@ ENV entity_spec_path=${base_path}/assets/entity-spec

ENV master_template_path=${base_path}/templates


# 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

# can be passed during Docker build as build time environment for artifactory URL
Expand All @@ -37,14 +30,6 @@ ARG artifactory_url
# environment variable to pass artifactory url, at docker runtime
ENV artifactory_url_env=${artifactory_url}

# install packages and create user
RUN apt-get -y update \
&& apt-get install -y unzip wget zip npm \
&& 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 /var/run/nginx /var/tmp/nginx \
&& chown -R ${container_user}:${container_user} /usr/share/nginx /var/run/nginx /var/tmp/nginx

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

Expand All @@ -54,24 +39,23 @@ ADD ./default.conf /etc/nginx/conf.d/

ADD ./download.conf /etc/nginx/include/download.conf

RUN cd /home/${container_user}

ADD dist ${base_path}

# install the needed packages including wget and a unzip library
#RUN apt-get update -y && apt-get install -y wget && apt-get install -y unzip

# change permissions of file inside working dir
RUN chown -R ${container_user}:${container_user} ${base_path}/assets/i18n
RUN chown -R ${container_user}:${container_user} ${base_path}/assets/entity-spec
RUN mkdir -p ${master_template_path} && chown -R ${container_user}:${container_user} ${master_template_path}


ADD configure_start.sh configure_start.sh

RUN chmod +x configure_start.sh

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 wget zip npm \
&& 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 /var/run/nginx /var/tmp/nginx \
&& chown -R ${container_user}:${container_user} /home/${container_user} /usr/share/nginx /var/run/nginx /var/tmp/nginx ${base_path}/assets/i18n ${base_path}/assets/entity-spec \
&& mkdir -p ${master_template_path} && chown -R ${container_user}:${container_user} ${master_template_path} \
&& chmod +x configure_start.sh \
&& cd /home/${container_user}

# select container user for all tasks
USER ${container_user_uid}:${container_user_gid}
Expand All @@ -82,21 +66,6 @@ ENTRYPOINT [ "./configure_start.sh" ]

#get the admin i18n bundle zip from artifactory
CMD echo "starting nginx" ; \
# wget -q --show-progress "${artifactory_url_env}"/artifactory/libs-release-local/i18n/admin-i18n-bundle.zip -O "${i18n_path}"/admin-i18n-bundle.zip ; \
# echo "Downloading entity spec bundle" ; \
# wget -q --show-progress "${artifactory_url_env}"/artifactory/libs-release-local/i18n/admin-entity-spec-bundle.zip -O "${entity_spec_path}"/admin-entity-spec-bundle.zip ; \
# echo "Downloading templates bundle" ; \
# wget -q --show-progress "${artifactory_url_env}"/artifactory/libs-release-local/master-templates/master-templates.zip -O "${master_template_path}"/master-templates.zip ; \
# cd ${entity_spec_path} ; \
# #zip -FF admin-entity-spec-bundle.zip --out admin-entity-spec-bundle_fixed.zip ; \
# unzip -o admin-entity-spec-bundle.zip ; \
# cd ${i18n_path} ; \
# #zip -FF admin-i18n-bundle.zip --out admin-i18n-bundle_fixed.zip ; \
# unzip -o admin-i18n-bundle.zip ; \
# cd ${master_template_path} ; \
# #zip -FF master-templates.zip --out master-templates_fixed.zip ; \
# unzip -o master-templates.zip ; \
nginx ; \
sleep infinity


4 changes: 2 additions & 2 deletions admintest/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ ARG KUBECTL_VERSION=1.22.9
# install packages and create user
RUN groupadd -g ${container_user_gid} ${container_user_group} \
&& useradd -u ${container_user_uid} -g ${container_user_group} -s /bin/bash -m ${container_user} -d ${work_dir} \
&& chown -R ${container_user}:${container_user} /home/${container_user}/ \
&& chown -R ${container_user}:${container_user} /home/${container_user} \
&& curl -LO "https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl" \
&& chmod +x kubectl \
&& mv kubectl /usr/local/bin/
&& mv kubectl /usr/local/bin/

# Switch to the specified user for the subsequent commands
USER ${container_user_uid}:${container_user_gid}
Expand Down
Loading