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

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 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
2 changes: 0 additions & 2 deletions .github/workflows/push-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ jobs:
strategy:
matrix:
include:
- SERVICE_LOCATION: 'keycloak-jboss'
SERVICE_NAME: 'mosip-jboss-keycloak'
- SERVICE_LOCATION: 'keycloak-init'
SERVICE_NAME: 'keycloak-init'
- SERVICE_LOCATION: 'keycloak-artemis'
Expand Down
14 changes: 13 additions & 1 deletion keycloak-artemis/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,19 @@ RUN chmod +x /usr/sbin/install_packages && chmod g+rwX /opt/bitnami && \
# Install required system packages and dependencies
RUN . /usr/sbin/install_packages acl ca-certificates curl gzip libaio1 libc6 procps rsync tar zlib1g

USER 1001
ARG container_user=mosip
ARG container_user_group=mosip
ARG container_user_uid=1001
ARG container_user_gid=1001

# Create and set ownership for the container user
RUN groupadd -g ${container_user_gid} ${container_user_group} && \
useradd -r -u ${container_user_uid} -g ${container_user_group} ${container_user} && \
mkdir -p /home/${container_user} && \
chown -R ${container_user}:${container_user} /home/${container_user}

USER ${container_user_uid}:${container_user_gid}
WORKDIR /home/${container_user}
abhishek8shankar marked this conversation as resolved.
Show resolved Hide resolved

ENTRYPOINT [ "/opt/bitnami/scripts/keycloak/entrypoint.sh" ]

Expand Down
20 changes: 6 additions & 14 deletions keycloak-init/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,18 @@ LABEL build_time=${BUILD_TIME}

# 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 \
&& groupadd -g ${container_user_gid} ${container_user_group} \
&& useradd -u ${container_user_uid} -g ${container_user_group} -s /bin/sh -m ${container_user}

COPY requirements.txt .
RUN pip3 install -r requirements.txt

# 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 \
&& groupadd -g ${container_user_gid} ${container_user_group} \
&& useradd -u ${container_user_uid} -g ${container_user_group} -s /bin/sh -m ${container_user} \
&& pip3 install -r requirements.txt \
&& chown -R ${container_user}:${container_user} /home/${container_user}

# select container user for all tasks
USER ${container_user_uid}:${container_user_gid}
Expand Down
7 changes: 7 additions & 0 deletions keycloak-jboss/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,10 @@ ADD --chown=jboss:root ./standalone/ ./standalone

RUN cp -R ./standalone/deployments/* /opt/jboss/keycloak/standalone/deployments

#ARG container_user=mosip
#ARG container_user_group=mosip
#ARG container_user_uid=1001
#ARG container_user_gid=1001
#WORKDIR /home/${container_user}
#RUN chown -R ${container_user}:${container_user} /home/${container_user}
#USER ${container_user_uid}:${container_user_gid}
abhishek8shankar marked this conversation as resolved.
Show resolved Hide resolved
Loading