Skip to content

Commit

Permalink
Add custom entrypoint with wrapper script for adaptive.sh execution w…
Browse files Browse the repository at this point in the history
…hen required (#166)

* Add custom entrypoint with wrapper script for adaptive.sh execution
* Update dockerfiles/jdk17/ubuntu/obiam/README.md

Co-authored-by: Hasitha Nanayakkara <[email protected]>
  • Loading branch information
Akila94 and hasithakn authored Apr 25, 2024
1 parent e8fbb90 commit 262e2bb
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dockerfiles/jdk17/alpine/obiam/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ RUN \
# change directory rights
RUN chown wso2carbon:wso2 -R ${WSO2_SERVER_HOME}/

# Copy wrapper script to user home (adaptive.sh + docker-entrypoint.sh).
# This wrapper script can be used to override the default entrypoint when using JDK17 with adaptive authentication.
COPY --chown=wso2carbon:wso2 docker-entrypoint-ob.sh ${USER_HOME}/

# set the non-root user
USER ${USER_ID}

Expand Down
8 changes: 8 additions & 0 deletions dockerfiles/jdk17/alpine/obiam/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ If you are using WSO2 Open Banking Identity Server and WSO2 Open Banking API Man
> - `docker run -it -p 9446:9446 -v <IS_CONNECTOR_HOME>/dropins:/home/wso2carbon/wso2-artifact-volume/repository/components/dropins/ -v <IS_CONNECTOR_HOME>/webapps:/home/wso2carbon/wso2-artifact-volume/repository/deployment/server/webapps/ wso2-obiam:3.0.0-alpine-jdk17`
> In here, <IS_CONNECTOR_HOME> refers to the root directory path of the extracted WSO2 IS Connector.
> Note: If adaptive authentication is required for the JDK17 docker container, add the following flag with the custom entrypoint path when starting the container. This will run the ```adaptive.sh``` script and download the necessary jars at the server start-up.
>
> ```--entrypoint "/home/wso2carbon/docker-entrypoint-ob.sh"```
>
> Sample command:
>
> ```docker run --entrypoint "/home/wso2carbon/docker-entrypoint-ob.sh" -it -p 9446:9446 wso2-obiam:3.0.0-alpine-jdk17```
##### 4. Accessing management console.

- To access the management console, use the docker host IP and port 9446.
Expand Down
15 changes: 15 additions & 0 deletions dockerfiles/jdk17/alpine/obiam/docker-entrypoint-ob.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh

set -e

# Execute adaptive.sh script
sh ${WSO2_SERVER_HOME}/bin/adaptive.sh "$@"

# Check the exit status
if [ $? -ne 0 ]; then
echo "Error executing adaptive.sh"
exit 1
fi

# Execute docker-entrypoint.sh script
sh /home/wso2carbon/docker-entrypoint.sh
4 changes: 4 additions & 0 deletions dockerfiles/jdk17/ubuntu/obiam/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ RUN \
chown wso2carbon:wso2 -R ${WSO2_SERVER_HOME}/ \
&& chown wso2carbon:wso2 /etc/motd

# Copy wrapper script to user home (adaptive.sh + docker-entrypoint.sh).
# This wrapper script can be used to override the default entrypoint when using JDK17 with adaptive authentication.
COPY --chown=wso2carbon:wso2 docker-entrypoint-ob.sh ${USER_HOME}/

# set the non-root user
USER ${USER_ID}

Expand Down
9 changes: 9 additions & 0 deletions dockerfiles/jdk17/ubuntu/obiam/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ If you are using WSO2 Open Banking Identity Server and WSO2 Open Banking API Man
> - `docker run -it -p 9446:9446 -v <IS_CONNECTOR_HOME>/dropins:/home/wso2carbon/wso2-artifact-volume/repository/components/dropins/ -v <IS_CONNECTOR_HOME>/webapps:/home/wso2carbon/wso2-artifact-volume/repository/deployment/server/webapps/ wso2-obiam:3.0.0-jdk17`
> In here, <IS_CONNECTOR_HOME> refers to the root directory path of the extracted WSO2 IS Connector.
> Note: If adaptive authentication is required for the JDK17 docker container, add the following flag with the custom entrypoint path when starting the container. This will run the ```adaptive.sh``` script and download the necessary jars at the server start-up.
>
> ```--entrypoint "/home/wso2carbon/docker-entrypoint-ob.sh"```
>
> Sample command:
>
> ```docker run --entrypoint "/home/wso2carbon/docker-entrypoint-ob.sh" -it -p 9446:9446 wso2-obiam:3.0.0-ubuntu-jdk17```

##### 4. Accessing management console.

- To access the management console, use the docker host IP and port 9446.
Expand Down
15 changes: 15 additions & 0 deletions dockerfiles/jdk17/ubuntu/obiam/docker-entrypoint-ob.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh

set -e

# Execute adaptive.sh script
sh ${WSO2_SERVER_HOME}/bin/adaptive.sh "$@"

# Check the exit status
if [ $? -ne 0 ]; then
echo "Error executing adaptive.sh"
exit 1
fi

# Execute docker-entrypoint.sh script
sh /home/wso2carbon/docker-entrypoint.sh

0 comments on commit 262e2bb

Please sign in to comment.