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. #1868

Closed
wants to merge 42 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
139a2e2
Update push-trigger.yml
abhishek8shankar Apr 3, 2024
f2a2b4e
[MOSIP-31575] Updated docker file.
abhishek8shankar Apr 3, 2024
c7dbcf0
[MOSIP-31575] Updated docker file.
abhishek8shankar Apr 3, 2024
f1a3069
[MOSIP-31575] Updated docker file.
abhishek8shankar Apr 3, 2024
9658a2f
[MOSIP-31575] Updated docker file.
abhishek8shankar Apr 3, 2024
1552cbf
[MOSIP-31575] Updated docker-not-used file.
abhishek8shankar Apr 3, 2024
63c7abe
[MOSIP-31575] Update Dockerfile-not-used
abhishek8shankar Apr 3, 2024
2434f27
[MOSIP-31575] Update Dockerfile-not-used
abhishek8shankar Apr 3, 2024
d4093f0
[MOSIP-31575] Update Dockerfile-not-used
abhishek8shankar Apr 3, 2024
c9bd13d
[MOSIP-31575] Update Dockerfile-not-used
abhishek8shankar Apr 3, 2024
d2af992
[MOSIP-31575] Update Dockerfile-not-used
abhishek8shankar Apr 3, 2024
b9a157a
[MOSIP-31575] Updated docker file.
abhishek8shankar Apr 3, 2024
d890954
[MOSIP-31575] Updated docker file.
abhishek8shankar Apr 3, 2024
b7595d0
[MOSIP-31575] Updated docker file.
abhishek8shankar Apr 3, 2024
2e3f5a9
[MOSIP-31575] Updated docker file.
abhishek8shankar Apr 3, 2024
5615f33
[MOSIP-31575] Updated docker file.
abhishek8shankar Apr 3, 2024
58cd0a7
[MOSIP-31575] Updated docker file.
abhishek8shankar Apr 3, 2024
5ee54ca
[MOSIP-31575] Updated docker file.
abhishek8shankar Apr 3, 2024
c75993c
[MOSIP-31575] Updated docker file.
abhishek8shankar Apr 3, 2024
e045a7a
[MOSIP-31575] Updated docker file.
abhishek8shankar Apr 3, 2024
4e30841
[MOSIP-31575] Updated docker file.
abhishek8shankar Apr 3, 2024
d22c2e2
[MOSIP-31575] Updated docker file.
abhishek8shankar Apr 3, 2024
7c2c4c1
Update push-trigger.yml
abhishek8shankar Apr 3, 2024
1246cb2
[MOSIP-31575] Updated docker file.
abhishek8shankar Apr 4, 2024
1df51ae
[MOSIP-31575] Updated docker file.
abhishek8shankar Apr 4, 2024
5ccfd44
[MOSIP-31575] Updated docker file.
abhishek8shankar Apr 4, 2024
f9cf683
[MOSIP-31575] Updated docker file.
abhishek8shankar Apr 4, 2024
0083ea3
[MOSIP-31575] Updated docker file.
abhishek8shankar Apr 4, 2024
883081d
[MOSIP-31575] Update Dockerfile-not-used
abhishek8shankar Apr 4, 2024
e2416b4
[MOSIP-31575] Update Dockerfile-not-used
abhishek8shankar Apr 4, 2024
c96a80b
[MOSIP-31575] Updated docker file.
abhishek8shankar Apr 4, 2024
03765a8
[MOSIP-31575] Update Dockerfile-not-used
abhishek8shankar Apr 4, 2024
5f0286f
[MOSIP-31575] Updated docker file.
abhishek8shankar Apr 4, 2024
ead5534
[MOSIP-31575] Update Dockerfile-not-used
abhishek8shankar Apr 4, 2024
308f733
[MOSIP-31575] Update Dockerfile-not-used
abhishek8shankar Apr 4, 2024
f10445c
[MOSIP-31575] Updated docker file.
abhishek8shankar Apr 4, 2024
a05e263
[MOSIP-31575] Updated docker file.
abhishek8shankar Apr 4, 2024
64c1d9d
[MOSIP-31575] Updated docker file.
abhishek8shankar Apr 5, 2024
2206407
[MOSIP-31575] Updated docker file.
abhishek8shankar Apr 5, 2024
db205c1
[MOSIP-31575] Updated docker file.
abhishek8shankar Apr 5, 2024
7883739
[MOSIP-31575] Updated docker file.
abhishek8shankar Apr 12, 2024
c1bdee6
[MOSIP-31575] Updated docker file.
abhishek8shankar Apr 12, 2024
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
Prev Previous commit
Next Next commit
[MOSIP-31575] Updated docker file.
Signed-off-by: abhishek8shankar <127825992+abhishek8shankar@users.noreply.github.com>
  • Loading branch information
abhishek8shankar authored Apr 3, 2024
commit b9a157ab91799034ed74c72263a71f8466219f9a
Original file line number Diff line number Diff line change
@@ -17,85 +17,56 @@ LABEL network=host
LABEL privileged=true
LABEL zone_env=dmz

# 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 | artifactory URL and for zone 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 zone
ARG zone

# 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
ENV active_profile_env=${active_profile}
ARG zone

# environment variable to pass zone i.e dmz or secure at docker runtime
ENV zone_env=${zone}

# environment variable to pass github branch to pickup configuration from, 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.
ENV active_profile_env=${active_profile}
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

RUN apt-get -y update \
&& apt-get install -y unzip sudo \
&& groupadd -g ${container_user_gid} ${container_user_group} \
&& useradd -u ${container_user_uid} -g ${container_user_group} -s /bin/sh -m ${container_user} \
&& adduser ${container_user} sudo

# 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}

# copying shaded jar into docker image
ADD ./target/*.jar ./target/

# change permissions of file inside working dir
RUN find target/ -regextype posix-extended -regex '.*registration-processor-common-camel-bridge-[0-9\.]+[-A-Za-z0-9]*\.jar' "-print0" | xargs "-0" cp -t ./ \
&& rm -rf ./target \
&& rm -rf original*.jar \
&& rm -rf *-sources.jar \
&& rm -rf *-javadoc.jar \
&& mv *.jar registration-processor-common-camel-bridge.jar

# change permissions of file inside working dir
RUN chown -R ${container_user}:${container_user} /home/${container_user}
&& mv *.jar registration-processor-common-camel-bridge.jar \
&& apt-get -y update \
&& apt-get install -y unzip sudo \
&& groupadd -g ${container_user_gid} ${container_user_group} \
&& useradd -u ${container_user_uid} -g ${container_user_group} -s /bin/sh -m ${container_user} \
&& adduser ${container_user} sudo \
&& 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}
@@ -112,6 +83,5 @@ CMD if [ "$is_glowroot_env" = "present" ]; then \
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}" -Dregistration.processor.zone="${zone_env}" registration-processor-common-camel-bridge.jar ; \
fi


# running java jar
#CMD java -jar -Dspring.cloud.config.label=${spring_config_label_env} -Dspring.profiles.active=${active_profile_env} -Dspring.cloud.config.uri=${spring_config_url_env} -Dregistration.processor.zone=${zone_env} registration-processor-common-camel-bridge.jar