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
Show file tree
Hide file tree
Changes from 37 commits
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
13 changes: 6 additions & 7 deletions .github/workflows/push-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
types: [published]
pull_request:
types: [opened, reopened, synchronize]

workflow_dispatch:
inputs:
message:
Expand All @@ -20,7 +20,7 @@ on:
- master
- 1.*
- develop

jobs:
build-maven-registration:
uses: mosip/kattu/.github/workflows/maven-build.yml@master
Expand All @@ -33,7 +33,7 @@ jobs:
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
GPG_SECRET: ${{ secrets.GPG_SECRET }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}

publish_to_nexus:
if: "${{ !contains(github.ref, 'master') && github.event_name != 'pull_request' && github.event_name != 'release' && github.event_name != 'prerelease' && github.event_name != 'publish' }}"
needs: build-maven-registration
Expand All @@ -47,7 +47,7 @@ jobs:
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
GPG_SECRET: ${{ secrets.GPG_SECRET }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}

build-dockers:
needs: build-maven-registration
strategy:
Expand Down Expand Up @@ -113,8 +113,7 @@ jobs:
ACTOR_DOCKER_HUB: ${{ secrets.ACTOR_DOCKER_HUB }}
RELEASE_DOCKER_HUB: ${{ secrets.RELEASE_DOCKER_HUB }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}



sonar_analysis:
needs: build-maven-registration
if: "${{ github.event_name != 'pull_request' }}"
Expand All @@ -128,4 +127,4 @@ jobs:
OSSRH_SECRET: ${{ secrets.OSSRH_SECRET }}
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
GPG_SECRET: ${{ secrets.GPG_SECRET }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
Original file line number Diff line number Diff line change
@@ -1,74 +1,57 @@
FROM openjdk:11

#Uncomment below and Comment above line(i.e. FROM openjdk:8) for OS specific (e.g. Alpine OS ) docker base image
#FROM openjdk:8-jdk-alpine

# 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
ARG SOURCE
ARG COMMIT_HASH
ARG COMMIT_ID
ARG BUILD_TIME
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 | 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 and artifactory url, at docker runtime .
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 github branch to pickup configuration from, at docker runtime
ENV spring_config_label_env=${spring_config_label}

# environment variable to pass glowroot, 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}

# can be passed during Docker build as build time environment for github branch to pickup configuration from.
# can be passed during Docker build as build time environment .
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}

# change volume to whichever storage directory you want to use for this container.
VOLUME ${work_dir}/logs ${work_dir}/Glowroot

ADD ./target/registration-processor-abis-*.jar registration-processor-abis.jar

# change permissions of file inside working dir
RUN chown -R ${container_user}:${container_user} /home/${container_user}
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 \
&& 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}
Expand All @@ -82,5 +65,4 @@ CMD if [ "$is_glowroot_env" = "present" ]; then \
else \
java -jar -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" registration-processor-abis.jar ; \
fi

#CMD ["java","-Dspring.cloud.config.label=${spring_config_label_env}","-Dspring.profiles.active=${active_profile_env}","-Dspring.cloud.config.uri=${spring_config_url_env}","-jar","registration-processor-abis.jar"]
Original file line number Diff line number Diff line change
@@ -1,9 +1,45 @@
FROM nginx

VOLUME /home/mosip
ARG SOURCE
ARG COMMIT_HASH
ARG COMMIT_ID
ARG BUILD_TIME
LABEL source=${SOURCE}
LABEL commit_hash=${COMMIT_HASH}
LABEL commit_id=${COMMIT_ID}
LABEL build_time=${BUILD_TIME}

# Define arguments
ARG container_user=mosip
ARG container_user_group=mosip
ARG container_user_uid=1001
ARG container_user_gid=1001

# Set the working directory
WORKDIR /home/${container_user}

# Copy nginx.conf file
COPY nginx.conf /etc/nginx/nginx.conf

# Copy healthcheck.txt file
COPY healthcheck.txt /home/${container_user}/landing/healthcheck.txt

#Create a user and group inside the container, Change ownership of /home/mosip directory
RUN addgroup --gid ${container_user_gid} ${container_user_group} && \
adduser --disabled-password --gecos '' --uid ${container_user_uid} --gid ${container_user_gid} ${container_user} && \
chown -R ${container_user}:${container_user} /home/${container_user}

# Change user and group to the created user and group
USER ${container_user_uid}:${container_user_gid}

# Expose port 8082
EXPOSE 8082

# Run nginx
VOLUME /home/mosip

COPY nginx.conf /etc/nginx/nginx.conf

COPY healthcheck.txt /home/mosip/landing/healthcheck.txt
abhishek8shankar marked this conversation as resolved.
Show resolved Hide resolved

EXPOSE 8082
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,46 @@ FROM openjdk:11
#Uncomment below and Comment above line(i.e. FROM openjdk:8) for OS specific (e.g. Alpine OS ) docker base image
#FROM openjdk:8-jdk-alpine

ARG SOURCE
ARG COMMIT_HASH
ARG COMMIT_ID
ARG BUILD_TIME
LABEL source=${SOURCE}
LABEL commit_hash=${COMMIT_HASH}
LABEL commit_id=${COMMIT_ID}
LABEL build_time=${BUILD_TIME}

# setting labels for extra properties needed for this Docker image, so that it can be used at run time with docker inspect
LABEL network=host
LABEL privileged=true

# 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
ARG active_profile

# can be passed during Docker build as build time environment for config server URL
# can be passed during Docker build as build time environment for github branch to pickup configuration from | for spring profiles active and config server URL respectively
ARG spring_config_label
ARG active_profile
ARG spring_config_url

# environment variable to pass active profile such as DEV, QA etc at docker runtime
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 github branch to pickup configuration from, at docker runtime
ENV spring_config_label_env=${spring_config_label}
ARG container_user=mosip
ARG container_user_group=mosip
ARG container_user_uid=1001
ARG container_user_gid=1001

# change volume to whichever storage directory you want to use for this container.
VOLUME /home/ftp1/ARCHIVE_PACKET_LOCATION /home/ftp1/LANDING_ZONE /home/Glowroot

COPY ./target/registration-processor-packet-receiver-stage-*.jar registration-processor-packet-receiver-stage.jar

EXPOSE 8081
EXPOSE 4001

WORKDIR /home/${container_user}

RUN chown -R ${container_user}:${container_user} /home/${container_user}

USER ${container_user_uid}:${container_user_gid}

CMD if [ "$active_profile_env" = "preprod" ]; then \
wget 'http://13.71.87.138:8040/artifactory/libs-release-local/io/mosip/testing/glowroot.zip' ; \
apt-get update && apt-get install -y unzip ; \
Expand All @@ -44,5 +54,4 @@ CMD if [ "$active_profile_env" = "preprod" ]; then \
else \
java -jar -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" registration-processor-packet-receiver-stage.jar ; \
fi

#CMD ["java","-Dspring.cloud.config.label=${spring_config_label_env}","-Dspring.profiles.active=${active_profile_env}","-Dspring.cloud.config.uri=${spring_config_url_env}","-jar","-javaagent:/home/Glowroot/glowroot.jar","registration-processor-packet-receiver-stage.jar"]
Original file line number Diff line number Diff line change
Expand Up @@ -3,71 +3,56 @@ FROM openjdk:11
#Uncomment below and Comment above line(i.e. FROM openjdk:8) for OS specific (e.g. Alpine OS ) docker base image
#FROM openjdk:8-jdk-alpine

# 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
ARG active_profile

# can be passed during Docker build as build time environment for config server URL
ARG SOURCE
ARG COMMIT_HASH
ARG COMMIT_ID
ARG BUILD_TIME
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 | spring profiles active and config server URL, respectively.
ARG spring_config_label
ARG active_profile
ARG spring_config_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

# 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 | iam_adapter url, at docker runtime | management rmi server hostname and management rmi server port, 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 github branch to pickup configuration from, at docker runtime
ENV spring_config_label_env=${spring_config_label}

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

# change volume to whichever storage directory you want to use for this container.
# change volume to whichever storage directory you want to use for this container.
VOLUME ${work_dir}/logs ${work_dir}/Glowroot

ADD ./target/registration-processor-registration-status-service-*.jar registration-processor-registration-status-service.jar

EXPOSE 8083
EXPOSE 4000

# change permissions of file inside working dir
RUN chown -R ${container_user}:${container_user} /home/${container_user}
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 \
&& 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}
Expand All @@ -84,5 +69,4 @@ CMD if [ "$active_profile_env" = "preprod" ]; then \
wget "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.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}" registration-processor-registration-status-service.jar; \
fi

#CMD ["java","-Dspring.cloud.config.label=${spring_config_label_env}","-Dspring.profiles.active=${active_profile_env}","-Dspring.cloud.config.uri=${spring_config_url_env}","-jar","-javaagent:/home/Glowroot/glowroot.jar","registration-processor-registration-status-service.jar"]
Loading
Loading