-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #258 from jayesh12234/develop
MOSIP-30901
- Loading branch information
Showing
18 changed files
with
1,487 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,45 @@ | ||
FROM openjdk:11-jre | ||
FROM selenium/standalone-chrome:latest | ||
|
||
USER root | ||
|
||
# Define build-time arguments | ||
ARG SOURCE | ||
ARG COMMIT_HASH | ||
ARG COMMIT_ID | ||
ARG BUILD_TIME | ||
|
||
# Set labels for metadata | ||
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. | ||
# Define build-time arguments for user and group | ||
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 | ||
|
||
# set working directory for the user | ||
# Set working directory for the user | ||
ENV work_dir=/home/${container_user}/ | ||
|
||
# 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} | ||
&& 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}/ | ||
|
||
# select container user for all tasks | ||
# Switch to the specified user for the subsequent commands | ||
USER ${container_user_uid}:${container_user_gid} | ||
|
||
# Copy files | ||
COPY --chown=${container_user_uid}:${container_user} --chmod=771 ./entrypoint.sh ${work_dir}/entrypoint.sh | ||
COPY --chown=${container_user}:${container_user} ./src/main/resources/ ${work_dir} | ||
COPY --chown=${container_user}:${container_user} ./src/main/resources/ ${work_dir}/resources/ | ||
COPY --chown=${container_user_uid}:${container_user} ./target/*.jar ${work_dir} | ||
|
||
# Set working directory | ||
WORKDIR /home/${container_user}/ | ||
|
||
|
||
# set working directory | ||
WORKDIR ${work_dir} | ||
|
||
ENTRYPOINT ["/bin/bash", "-c", "./entrypoint.sh"] | ||
# Entrypoint for the container | ||
ENTRYPOINT ["/bin/bash", "-c", "./entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.