From 02b551f5abac57d1b418382936522cc619be538c Mon Sep 17 00:00:00 2001 From: chirangaalwis Date: Wed, 9 Jan 2019 15:55:43 +0530 Subject: [PATCH 1/4] Remove Docker resources for WSO2 Enterprise Integrator base image --- dockerfiles/ubuntu/analytics/dashboard/files/.gitkeep | 0 dockerfiles/ubuntu/analytics/worker/files/.gitkeep | 0 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 dockerfiles/ubuntu/analytics/dashboard/files/.gitkeep delete mode 100644 dockerfiles/ubuntu/analytics/worker/files/.gitkeep diff --git a/dockerfiles/ubuntu/analytics/dashboard/files/.gitkeep b/dockerfiles/ubuntu/analytics/dashboard/files/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/dockerfiles/ubuntu/analytics/worker/files/.gitkeep b/dockerfiles/ubuntu/analytics/worker/files/.gitkeep deleted file mode 100644 index e69de29b..00000000 From 57efe804b7c2bff7e9dac6435e4437abcd7e4a7a Mon Sep 17 00:00:00 2001 From: chirangaalwis Date: Wed, 9 Jan 2019 15:58:23 +0530 Subject: [PATCH 2/4] Integrate the usage of AdoptOpenJDK 8 to Ubuntu based Docker resources, add support for passing arguments to Docker images and optimize Docker images --- .../ubuntu/{ => analytics}/base/Dockerfile | 21 ++---- .../{ => analytics}/base/files/.gitkeep | 0 .../ubuntu/analytics/dashboard/Dockerfile | 3 +- .../ubuntu/analytics/dashboard/init.sh | 2 +- .../ubuntu/analytics/worker/Dockerfile | 3 +- dockerfiles/ubuntu/analytics/worker/init.sh | 2 +- dockerfiles/ubuntu/broker/Dockerfile | 68 ++++++++++++++++-- dockerfiles/ubuntu/broker/files/.gitkeep | 0 dockerfiles/ubuntu/broker/init.sh | 17 +---- .../ubuntu/business-process/Dockerfile | 68 ++++++++++++++++-- .../ubuntu/business-process/files/.gitkeep | 0 dockerfiles/ubuntu/business-process/init.sh | 2 +- dockerfiles/ubuntu/integrator/Dockerfile | 69 ++++++++++++++++--- dockerfiles/ubuntu/integrator/init.sh | 2 +- .../ubuntu/micro-integrator/Dockerfile | 64 ++++++++++++++++- .../ubuntu/micro-integrator/files/.gitkeep | 0 dockerfiles/ubuntu/micro-integrator/init.sh | 2 +- dockerfiles/ubuntu/msf4j/Dockerfile | 55 +++++++++++++-- dockerfiles/ubuntu/msf4j/files/.gitkeep | 0 dockerfiles/ubuntu/msf4j/init.sh | 2 +- 20 files changed, 310 insertions(+), 70 deletions(-) rename dockerfiles/ubuntu/{ => analytics}/base/Dockerfile (73%) rename dockerfiles/ubuntu/{ => analytics}/base/files/.gitkeep (100%) create mode 100644 dockerfiles/ubuntu/broker/files/.gitkeep create mode 100644 dockerfiles/ubuntu/business-process/files/.gitkeep create mode 100644 dockerfiles/ubuntu/micro-integrator/files/.gitkeep create mode 100644 dockerfiles/ubuntu/msf4j/files/.gitkeep diff --git a/dockerfiles/ubuntu/base/Dockerfile b/dockerfiles/ubuntu/analytics/base/Dockerfile similarity index 73% rename from dockerfiles/ubuntu/base/Dockerfile rename to dockerfiles/ubuntu/analytics/base/Dockerfile index e74d12ac..681372ea 100644 --- a/dockerfiles/ubuntu/base/Dockerfile +++ b/dockerfiles/ubuntu/analytics/base/Dockerfile @@ -16,8 +16,8 @@ # # ------------------------------------------------------------------------ -# set to latest Ubuntu LTS -FROM ubuntu:18.04 +# set base Docker image to AdoptOpenJDK Ubuntu Docker image +FROM adoptopenjdk/openjdk8:jdk8u192-b12 MAINTAINER WSO2 Docker Maintainers "dev@wso2.org" # set user configurations @@ -28,9 +28,6 @@ ARG USER_GROUP_ID=802 ARG USER_HOME=/home/${USER} # set dependant files directory ARG FILES=./files -# set jdk configurations -ARG JDK=jdk1.8.0* -ARG JAVA_HOME=${USER_HOME}/java # set wso2 product configurations ARG WSO2_SERVER=wso2ei ARG WSO2_SERVER_VERSION=6.4.0 @@ -58,20 +55,14 @@ RUN apt-get update && \ RUN groupadd --system -g ${USER_GROUP_ID} ${USER_GROUP} && \ useradd --system --create-home --home-dir ${USER_HOME} --no-log-init -g ${USER_GROUP_ID} -u ${USER_ID} ${USER} -# copy jdk, wso2 product distribution to user's home directory and copy mysql connector jar to product distribution -COPY --chown=wso2carbon:wso2 ${FILES}/${JDK} ${JAVA_HOME} +# copy wso2 product distribution to user's home directory and copy mysql connector jar to product distribution COPY --chown=wso2carbon:wso2 ${FILES}/${WSO2_SERVER_PACK} ${WSO2_SERVER_HOME} -COPY --chown=wso2carbon:wso2 ${FILES}/mysql-connector-java-*-bin.jar ${WSO2_SERVER_HOME}/lib -# add libraries for Kubernetes membership scheme based clustering -ADD --chown=wso2carbon:wso2 https://repo1.maven.org/maven2/dnsjava/dnsjava/2.1.8/dnsjava-2.1.8.jar ${WSO2_SERVER_HOME}/lib -ADD --chown=wso2carbon:wso2 https://repo1.maven.org/maven2/org/wso2/carbon/kubernetes/artifacts/kubernetes-membership-scheme/1.0.5/kubernetes-membership-scheme-1.0.5.jar ${WSO2_SERVER_HOME}/dropins +COPY --chown=wso2carbon:wso2 ${FILES}/mysql-connector-java-*-bin.jar ${WSO2_SERVER_HOME}/wso2/analytics/lib/ # set the user and work directory -USER ${USER} +USER ${USER_ID} WORKDIR ${USER_HOME} # set environment variables -ENV JAVA_HOME=${JAVA_HOME} \ - PATH=$JAVA_HOME/bin:$PATH \ - WSO2_SERVER_HOME=${WSO2_SERVER_HOME} \ +ENV WSO2_SERVER_HOME=${WSO2_SERVER_HOME} \ WORKING_DIRECTORY=${USER_HOME} diff --git a/dockerfiles/ubuntu/base/files/.gitkeep b/dockerfiles/ubuntu/analytics/base/files/.gitkeep similarity index 100% rename from dockerfiles/ubuntu/base/files/.gitkeep rename to dockerfiles/ubuntu/analytics/base/files/.gitkeep diff --git a/dockerfiles/ubuntu/analytics/dashboard/Dockerfile b/dockerfiles/ubuntu/analytics/dashboard/Dockerfile index bf2ca867..acb3a47d 100644 --- a/dockerfiles/ubuntu/analytics/dashboard/Dockerfile +++ b/dockerfiles/ubuntu/analytics/dashboard/Dockerfile @@ -17,14 +17,13 @@ # ------------------------------------------------------------------------ # set to product base image -FROM wso2ei-base:6.4.0 +FROM wso2ei-analytics-base:6.4.0 # set dependant files directory ARG FILES=./files # copy entrypoint bash script to user home COPY --chown=wso2carbon:wso2 init.sh ${WORKING_DIRECTORY}/ -COPY --chown=wso2carbon:wso2 ${FILES}/mysql-connector-java-*-bin.jar ${WSO2_SERVER_HOME}/wso2/analytics/lib/ # expose analytics ports EXPOSE 9713 9643 9613 7713 7613 diff --git a/dockerfiles/ubuntu/analytics/dashboard/init.sh b/dockerfiles/ubuntu/analytics/dashboard/init.sh index 5a077ab3..8ff02f1b 100755 --- a/dockerfiles/ubuntu/analytics/dashboard/init.sh +++ b/dockerfiles/ubuntu/analytics/dashboard/init.sh @@ -32,4 +32,4 @@ test -d ${config_volume}/ && cp -RL ${config_volume}/* ${WSO2_SERVER_HOME}/ test -d ${artifact_volume}/ && cp -RL ${artifact_volume}/* ${WSO2_SERVER_HOME}/ # start WSO2 Carbon server -sh ${WSO2_SERVER_HOME}/bin/analytics-dashboard.sh +sh ${WSO2_SERVER_HOME}/bin/analytics-dashboard.sh "$@" diff --git a/dockerfiles/ubuntu/analytics/worker/Dockerfile b/dockerfiles/ubuntu/analytics/worker/Dockerfile index efd3a878..50a478cb 100644 --- a/dockerfiles/ubuntu/analytics/worker/Dockerfile +++ b/dockerfiles/ubuntu/analytics/worker/Dockerfile @@ -17,14 +17,13 @@ # ------------------------------------------------------------------------ # set to product base image -FROM wso2ei-base:6.4.0 +FROM wso2ei-analytics-base:6.4.0 # set dependant files directory ARG FILES=./files # copy entrypoint bash script to user home COPY --chown=wso2carbon:wso2 init.sh ${WORKING_DIRECTORY}/ -COPY --chown=wso2carbon:wso2 ${FILES}/mysql-connector-java-*-bin.jar ${WSO2_SERVER_HOME}/wso2/analytics/lib/ # expose analytics ports EXPOSE 9091 9444 9712 9612 7712 7612 7070 7443 diff --git a/dockerfiles/ubuntu/analytics/worker/init.sh b/dockerfiles/ubuntu/analytics/worker/init.sh index fabd84de..b252b05c 100755 --- a/dockerfiles/ubuntu/analytics/worker/init.sh +++ b/dockerfiles/ubuntu/analytics/worker/init.sh @@ -32,4 +32,4 @@ test -d ${config_volume}/ && cp -RL ${config_volume}/* ${WSO2_SERVER_HOME}/ test -d ${artifact_volume}/ && cp -RL ${artifact_volume}/* ${WSO2_SERVER_HOME}/ # start WSO2 Carbon server -sh ${WSO2_SERVER_HOME}/bin/analytics-worker.sh +sh ${WSO2_SERVER_HOME}/bin/analytics-worker.sh "$@" diff --git a/dockerfiles/ubuntu/broker/Dockerfile b/dockerfiles/ubuntu/broker/Dockerfile index b2052192..e21d31bc 100644 --- a/dockerfiles/ubuntu/broker/Dockerfile +++ b/dockerfiles/ubuntu/broker/Dockerfile @@ -1,6 +1,6 @@ # ------------------------------------------------------------------------ # -# Copyright 2018 WSO2, Inc. (http://wso2.com) +# Copyright 2017 WSO2, Inc. (http://wso2.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,15 +16,69 @@ # # ------------------------------------------------------------------------ -# set to product base image -FROM wso2ei-base:6.4.0 +# set base Docker image to AdoptOpenJDK Ubuntu Docker image +FROM adoptopenjdk/openjdk8:jdk8u192-b12 +MAINTAINER WSO2 Docker Maintainers "dev@wso2.org" +# set user configurations +ARG USER=wso2carbon +ARG USER_ID=802 +ARG USER_GROUP=wso2 +ARG USER_GROUP_ID=802 +ARG USER_HOME=/home/${USER} +# set dependant files directory +ARG FILES=./files +# set wso2 product configurations +ARG WSO2_SERVER=wso2ei +ARG WSO2_SERVER_VERSION=6.4.0 +ARG WSO2_SERVER_PACK=${WSO2_SERVER}-${WSO2_SERVER_VERSION} +ARG WSO2_SERVER_HOME=${USER_HOME}/${WSO2_SERVER_PACK} +# set WSO2 EULA +ARG MOTD="\n\ +Welcome to WSO2 Docker resources.\n\ +------------------------------------ \n\ +This Docker container comprises of a WSO2 product, running with its latest GA release \n\ +which is under the Apache License, Version 2.0. \n\ +Read more about Apache License, Version 2.0 here @ http://www.apache.org/licenses/LICENSE-2.0.\n" + +# install required packages +RUN apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + curl \ + netcat && \ + rm -rf /var/lib/apt/lists/* && \ + echo '[ ! -z "$TERM" -a -r /etc/motd ] && cat /etc/motd' \ + >> /etc/bash.bashrc \ + ; echo "$MOTD" > /etc/motd + +# create a user group and a user +RUN groupadd --system -g ${USER_GROUP_ID} ${USER_GROUP} && \ + useradd --system --create-home --home-dir ${USER_HOME} --no-log-init -g ${USER_GROUP_ID} -u ${USER_ID} ${USER} + +# create java prefs dir +# this is to avoid warning logs printed by FileSystemPreferences class +RUN mkdir -p ${USER_HOME}/.java/.systemPrefs && \ + mkdir -p ${USER_HOME}/.java/.userPrefs && \ + chmod -R 755 ${USER_HOME}/.java && \ + chown -R ${USER}:${USER_GROUP} ${USER_HOME}/.java + +# copy wso2 product distribution to user's home directory and copy mysql connector jar to product distribution +COPY --chown=wso2carbon:wso2 ${FILES}/${WSO2_SERVER_PACK} ${WSO2_SERVER_HOME} +COPY --chown=wso2carbon:wso2 ${FILES}/mysql-connector-java-*-bin.jar ${WSO2_SERVER_HOME}/lib # copy entrypoint bash script to user home -COPY --chown=wso2carbon:wso2 init.sh ${WORKING_DIRECTORY}/ +COPY --chown=wso2carbon:wso2 init.sh ${USER_HOME}/ +# add libraries for Kubernetes membership scheme based clustering +ADD --chown=wso2carbon:wso2 https://repo1.maven.org/maven2/dnsjava/dnsjava/2.1.8/dnsjava-2.1.8.jar ${WSO2_SERVER_HOME}/lib +ADD --chown=wso2carbon:wso2 https://repo1.maven.org/maven2/org/wso2/carbon/kubernetes/artifacts/kubernetes-membership-scheme/1.0.5/kubernetes-membership-scheme-1.0.5.jar ${WSO2_SERVER_HOME}/dropins + +# set the user and work directory +USER ${USER_ID} +WORKDIR ${USER_HOME} -# set temporary location for shared artifacts -RUN mkdir -p ${WORKING_DIRECTORY}/wso2-tmp/ && \ - cp -r ${WSO2_SERVER_HOME}/wso2/broker/repository/deployment/ ${WORKING_DIRECTORY}/wso2-tmp/deployment/ +# set environment variables +ENV WSO2_SERVER_HOME=${WSO2_SERVER_HOME} \ + WORKING_DIRECTORY=${USER_HOME} \ + JAVA_OPTS="-Djava.util.prefs.systemRoot=${USER_HOME}/.java -Djava.util.prefs.userRoot=${USER_HOME}/.java/.userPrefs" # expose broker ports EXPOSE 9446 9766 5675 8675 1886 8836 7614 4000 diff --git a/dockerfiles/ubuntu/broker/files/.gitkeep b/dockerfiles/ubuntu/broker/files/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/dockerfiles/ubuntu/broker/init.sh b/dockerfiles/ubuntu/broker/init.sh index fd944704..00e5111c 100755 --- a/dockerfiles/ubuntu/broker/init.sh +++ b/dockerfiles/ubuntu/broker/init.sh @@ -22,10 +22,6 @@ server_profile=broker # volume mounts config_volume=${WORKING_DIRECTORY}/wso2-config-volume artifact_volume=${WORKING_DIRECTORY}/wso2-artifact-volume -deployment_volume=${WSO2_SERVER_HOME}/wso2/${server_profile}/repository/deployment - -# original deployment artifacts -original_deployment_artifacts=${WORKING_DIRECTORY}/wso2-tmp/deployment # capture Docker container IP from the container's /etc/hosts file docker_container_ip=$(awk 'END{print $1}' /etc/hosts) @@ -36,17 +32,6 @@ test ! -d ${WORKING_DIRECTORY} && echo "WSO2 Docker non-root user home does not # check if the WSO2 product home exists test ! -d ${WSO2_SERVER_HOME} && echo "WSO2 Docker product home does not exist" && exit 1 -# if a deployment_volume is present and empty, copy original deployment artifacts to server... -# copying original artifacts to ${WORKING_DIRECTORY}/wso2-tmp/deployment was already done in the Dockerfile -# these artifacts will be copied to deployment_volume if it is empty, before the server is started -if test -d ${original_deployment_artifacts}; then - if [ -z "$(ls -A ${deployment_volume}/)" ]; then - # if no artifact is found under /wso2/broker/repository/deployment; copy originals - echo "Copying original deployment artifacts from temporary location to server..." - cp -R ${original_deployment_artifacts}/* ${deployment_volume}/ - fi -fi - # copy any configuration changes mounted to config_volume test -d ${config_volume}/ && cp -RL ${config_volume}/* ${WSO2_SERVER_HOME}/ # copy any artifact changes mounted to artifact_volume @@ -59,4 +44,4 @@ sed -i "s##.*#${docker_container_ip}#" ${WSO2_SERVER_HOME}/wso2/${server_profile}/conf/broker.xml # start WSO2 Carbon server -sh ${WSO2_SERVER_HOME}/bin/${server_profile}.sh +sh ${WSO2_SERVER_HOME}/bin/${server_profile}.sh "$@" diff --git a/dockerfiles/ubuntu/business-process/Dockerfile b/dockerfiles/ubuntu/business-process/Dockerfile index 32ef1aa5..1161d118 100644 --- a/dockerfiles/ubuntu/business-process/Dockerfile +++ b/dockerfiles/ubuntu/business-process/Dockerfile @@ -1,6 +1,6 @@ # ------------------------------------------------------------------------ # -# Copyright 2018 WSO2, Inc. (http://wso2.com) +# Copyright 2017 WSO2, Inc. (http://wso2.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,15 +16,69 @@ # # ------------------------------------------------------------------------ -# set to product base image -FROM wso2ei-base:6.4.0 +# set base Docker image to AdoptOpenJDK Ubuntu Docker image +FROM adoptopenjdk/openjdk8:jdk8u192-b12 +MAINTAINER WSO2 Docker Maintainers "dev@wso2.org" +# set user configurations +ARG USER=wso2carbon +ARG USER_ID=802 +ARG USER_GROUP=wso2 +ARG USER_GROUP_ID=802 +ARG USER_HOME=/home/${USER} +# set dependant files directory +ARG FILES=./files +# set wso2 product configurations +ARG WSO2_SERVER=wso2ei +ARG WSO2_SERVER_VERSION=6.4.0 +ARG WSO2_SERVER_PACK=${WSO2_SERVER}-${WSO2_SERVER_VERSION} +ARG WSO2_SERVER_HOME=${USER_HOME}/${WSO2_SERVER_PACK} +# set WSO2 EULA +ARG MOTD="\n\ +Welcome to WSO2 Docker resources.\n\ +------------------------------------ \n\ +This Docker container comprises of a WSO2 product, running with its latest GA release \n\ +which is under the Apache License, Version 2.0. \n\ +Read more about Apache License, Version 2.0 here @ http://www.apache.org/licenses/LICENSE-2.0.\n" + +# install required packages +RUN apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + curl \ + netcat && \ + rm -rf /var/lib/apt/lists/* && \ + echo '[ ! -z "$TERM" -a -r /etc/motd ] && cat /etc/motd' \ + >> /etc/bash.bashrc \ + ; echo "$MOTD" > /etc/motd + +# create a user group and a user +RUN groupadd --system -g ${USER_GROUP_ID} ${USER_GROUP} && \ + useradd --system --create-home --home-dir ${USER_HOME} --no-log-init -g ${USER_GROUP_ID} -u ${USER_ID} ${USER} + +# create java prefs dir +# this is to avoid warning logs printed by FileSystemPreferences class +RUN mkdir -p ${USER_HOME}/.java/.systemPrefs && \ + mkdir -p ${USER_HOME}/.java/.userPrefs && \ + chmod -R 755 ${USER_HOME}/.java && \ + chown -R ${USER}:${USER_GROUP} ${USER_HOME}/.java + +# copy wso2 product distribution to user's home directory and copy mysql connector jar to product distribution +COPY --chown=wso2carbon:wso2 ${FILES}/${WSO2_SERVER_PACK} ${WSO2_SERVER_HOME} +COPY --chown=wso2carbon:wso2 ${FILES}/mysql-connector-java-*-bin.jar ${WSO2_SERVER_HOME}/lib # copy entrypoint bash script to user home -COPY --chown=wso2carbon:wso2 init.sh ${WORKING_DIRECTORY}/ +COPY --chown=wso2carbon:wso2 init.sh ${USER_HOME}/ +# add libraries for Kubernetes membership scheme based clustering +ADD --chown=wso2carbon:wso2 https://repo1.maven.org/maven2/dnsjava/dnsjava/2.1.8/dnsjava-2.1.8.jar ${WSO2_SERVER_HOME}/lib +ADD --chown=wso2carbon:wso2 https://repo1.maven.org/maven2/org/wso2/carbon/kubernetes/artifacts/kubernetes-membership-scheme/1.0.5/kubernetes-membership-scheme-1.0.5.jar ${WSO2_SERVER_HOME}/dropins + +# set the user and work directory +USER ${USER_ID} +WORKDIR ${USER_HOME} -# set temporary location for shared artifacts -RUN mkdir -p ${WORKING_DIRECTORY}/wso2-tmp/ && \ - cp -r ${WSO2_SERVER_HOME}/wso2/business-process/repository/deployment/server/ ${WORKING_DIRECTORY}/wso2-tmp/server/ +# set environment variables +ENV WSO2_SERVER_HOME=${WSO2_SERVER_HOME} \ + WORKING_DIRECTORY=${USER_HOME} \ + JAVA_OPTS="-Djava.util.prefs.systemRoot=${USER_HOME}/.java -Djava.util.prefs.userRoot=${USER_HOME}/.java/.userPrefs" # expose business-process ports EXPOSE 9445 9765 4000 diff --git a/dockerfiles/ubuntu/business-process/files/.gitkeep b/dockerfiles/ubuntu/business-process/files/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/dockerfiles/ubuntu/business-process/init.sh b/dockerfiles/ubuntu/business-process/init.sh index b0781365..c90d0aba 100755 --- a/dockerfiles/ubuntu/business-process/init.sh +++ b/dockerfiles/ubuntu/business-process/init.sh @@ -59,4 +59,4 @@ sed -i "s##.*<\/tns:NodeId>#${docker_container_ip}<\/tns:NodeId>#" ${WSO2_SERVER_HOME}/wso2/${server_profile}/conf/bps.xml # start WSO2 Carbon server -sh ${WSO2_SERVER_HOME}/bin/${server_profile}.sh +sh ${WSO2_SERVER_HOME}/bin/${server_profile}.sh "$@" diff --git a/dockerfiles/ubuntu/integrator/Dockerfile b/dockerfiles/ubuntu/integrator/Dockerfile index 983aeeb5..ffbc9cd9 100644 --- a/dockerfiles/ubuntu/integrator/Dockerfile +++ b/dockerfiles/ubuntu/integrator/Dockerfile @@ -1,6 +1,6 @@ # ------------------------------------------------------------------------ # -# Copyright 2018 WSO2, Inc. (http://wso2.com) +# Copyright 2017 WSO2, Inc. (http://wso2.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,19 +16,72 @@ # # ------------------------------------------------------------------------ -# set to product base image -FROM wso2ei-base:6.4.0 +# set base Docker image to AdoptOpenJDK Ubuntu Docker image +FROM adoptopenjdk/openjdk8:jdk8u192-b12 +MAINTAINER WSO2 Docker Maintainers "dev@wso2.org" +# set user configurations +ARG USER=wso2carbon +ARG USER_ID=802 +ARG USER_GROUP=wso2 +ARG USER_GROUP_ID=802 +ARG USER_HOME=/home/${USER} # set dependant files directory ARG FILES=./files +# set wso2 product configurations +ARG WSO2_SERVER=wso2ei +ARG WSO2_SERVER_VERSION=6.4.0 +ARG WSO2_SERVER_PACK=${WSO2_SERVER}-${WSO2_SERVER_VERSION} +ARG WSO2_SERVER_HOME=${USER_HOME}/${WSO2_SERVER_PACK} +# set WSO2 EULA +ARG MOTD="\n\ +Welcome to WSO2 Docker resources.\n\ +------------------------------------ \n\ +This Docker container comprises of a WSO2 product, running with its latest GA release \n\ +which is under the Apache License, Version 2.0. \n\ +Read more about Apache License, Version 2.0 here @ http://www.apache.org/licenses/LICENSE-2.0.\n" -# copy entrypoint bash script to user home and external libraries to product home -COPY --chown=wso2carbon:wso2 init.sh ${WORKING_DIRECTORY}/ -COPY --chown=wso2carbon:wso2 ${FILES} ${WSO2_SERVER_HOME}/lib +# install required packages +RUN apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + curl \ + netcat && \ + rm -rf /var/lib/apt/lists/* && \ + echo '[ ! -z "$TERM" -a -r /etc/motd ] && cat /etc/motd' \ + >> /etc/bash.bashrc \ + ; echo "$MOTD" > /etc/motd + +# create a user group and a user +RUN groupadd --system -g ${USER_GROUP_ID} ${USER_GROUP} && \ + useradd --system --create-home --home-dir ${USER_HOME} --no-log-init -g ${USER_GROUP_ID} -u ${USER_ID} ${USER} + +# create java prefs dir +# this is to avoid warning logs printed by FileSystemPreferences class +RUN mkdir -p ${USER_HOME}/.java/.systemPrefs && \ + mkdir -p ${USER_HOME}/.java/.userPrefs && \ + chmod -R 755 ${USER_HOME}/.java && \ + chown -R ${USER}:${USER_GROUP} ${USER_HOME}/.java + +# copy wso2 product distribution to user's home directory and copy relevant libraries (mysql connector jar and integrator libraries) to product distribution +COPY --chown=wso2carbon:wso2 ${FILES}/${WSO2_SERVER_PACK} ${WSO2_SERVER_HOME} +COPY --chown=wso2carbon:wso2 ${FILES}/lib ${WSO2_SERVER_HOME}/lib +# copy entrypoint bash script to user home +COPY --chown=wso2carbon:wso2 init.sh ${USER_HOME}/ +# add libraries for Kubernetes membership scheme based clustering +ADD --chown=wso2carbon:wso2 https://repo1.maven.org/maven2/dnsjava/dnsjava/2.1.8/dnsjava-2.1.8.jar ${WSO2_SERVER_HOME}/lib +ADD --chown=wso2carbon:wso2 https://repo1.maven.org/maven2/org/wso2/carbon/kubernetes/artifacts/kubernetes-membership-scheme/1.0.5/kubernetes-membership-scheme-1.0.5.jar ${WSO2_SERVER_HOME}/dropins # set temporary location for shared artifacts -RUN mkdir -p ${WORKING_DIRECTORY}/wso2-tmp/ && \ - cp -r ${WSO2_SERVER_HOME}/repository/deployment/server/ ${WORKING_DIRECTORY}/wso2-tmp/server/ +RUN mkdir -p ${WORKING_DIRECTORY}/wso2-tmp/ && cp -r ${WSO2_SERVER_HOME}/repository/deployment/server/ ${WORKING_DIRECTORY}/wso2-tmp/server/ + +# set the user and work directory +USER ${USER_ID} +WORKDIR ${USER_HOME} + +# set environment variables +ENV WSO2_SERVER_HOME=${WSO2_SERVER_HOME} \ + WORKING_DIRECTORY=${USER_HOME} \ + JAVA_OPTS="-Djava.util.prefs.systemRoot=${USER_HOME}/.java -Djava.util.prefs.userRoot=${USER_HOME}/.java/.userPrefs" # expose integrator ports EXPOSE 8280 8243 9443 4100 diff --git a/dockerfiles/ubuntu/integrator/init.sh b/dockerfiles/ubuntu/integrator/init.sh index 10a2759b..29fd6122 100755 --- a/dockerfiles/ubuntu/integrator/init.sh +++ b/dockerfiles/ubuntu/integrator/init.sh @@ -54,4 +54,4 @@ test -d ${artifact_volume}/ && cp -RL ${artifact_volume}/* ${WSO2_SERVER_HOME}/ sed -i "s##${docker_container_ip}<\/parameter>#" ${WSO2_SERVER_HOME}/conf/axis2/axis2.xml # start WSO2 Carbon server -sh ${WSO2_SERVER_HOME}/bin/integrator.sh +sh ${WSO2_SERVER_HOME}/bin/integrator.sh "$@" diff --git a/dockerfiles/ubuntu/micro-integrator/Dockerfile b/dockerfiles/ubuntu/micro-integrator/Dockerfile index 6155031d..29479eed 100644 --- a/dockerfiles/ubuntu/micro-integrator/Dockerfile +++ b/dockerfiles/ubuntu/micro-integrator/Dockerfile @@ -16,11 +16,69 @@ # # ------------------------------------------------------------------------ -# set to product base image -FROM wso2ei-base:6.4.0 +# set base Docker image to AdoptOpenJDK Ubuntu Docker image +FROM adoptopenjdk/openjdk8:jdk8u192-b12 +MAINTAINER WSO2 Docker Maintainers "dev@wso2.org" +# set user configurations +ARG USER=wso2carbon +ARG USER_ID=802 +ARG USER_GROUP=wso2 +ARG USER_GROUP_ID=802 +ARG USER_HOME=/home/${USER} +# set dependant files directory +ARG FILES=./files +# set wso2 product configurations +ARG WSO2_SERVER=wso2ei +ARG WSO2_SERVER_VERSION=6.4.0 +ARG WSO2_SERVER_PACK=${WSO2_SERVER}-${WSO2_SERVER_VERSION} +ARG WSO2_SERVER_HOME=${USER_HOME}/${WSO2_SERVER_PACK} +# set WSO2 EULA +ARG MOTD="\n\ +Welcome to WSO2 Docker resources.\n\ +------------------------------------ \n\ +This Docker container comprises of a WSO2 product, running with its latest GA release \n\ +which is under the Apache License, Version 2.0. \n\ +Read more about Apache License, Version 2.0 here @ http://www.apache.org/licenses/LICENSE-2.0.\n" + +# install required packages +RUN apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + curl \ + netcat && \ + rm -rf /var/lib/apt/lists/* && \ + echo '[ ! -z "$TERM" -a -r /etc/motd ] && cat /etc/motd' \ + >> /etc/bash.bashrc \ + ; echo "$MOTD" > /etc/motd + +# create a user group and a user +RUN groupadd --system -g ${USER_GROUP_ID} ${USER_GROUP} && \ + useradd --system --create-home --home-dir ${USER_HOME} --no-log-init -g ${USER_GROUP_ID} -u ${USER_ID} ${USER} + +# create java prefs dir +# this is to avoid warning logs printed by FileSystemPreferences class +RUN mkdir -p ${USER_HOME}/.java/.systemPrefs && \ + mkdir -p ${USER_HOME}/.java/.userPrefs && \ + chmod -R 755 ${USER_HOME}/.java && \ + chown -R ${USER}:${USER_GROUP} ${USER_HOME}/.java + +# copy wso2 product distribution to user's home directory and copy mysql connector jar to product distribution +COPY --chown=wso2carbon:wso2 ${FILES}/${WSO2_SERVER_PACK} ${WSO2_SERVER_HOME} +COPY --chown=wso2carbon:wso2 ${FILES}/mysql-connector-java-*-bin.jar ${WSO2_SERVER_HOME}/lib # copy entrypoint bash script to user home -COPY --chown=wso2carbon:wso2 init.sh ${WORKING_DIRECTORY}/ +COPY --chown=wso2carbon:wso2 init.sh ${USER_HOME}/ +# add libraries for Kubernetes membership scheme based clustering +ADD --chown=wso2carbon:wso2 https://repo1.maven.org/maven2/dnsjava/dnsjava/2.1.8/dnsjava-2.1.8.jar ${WSO2_SERVER_HOME}/lib +ADD --chown=wso2carbon:wso2 https://repo1.maven.org/maven2/org/wso2/carbon/kubernetes/artifacts/kubernetes-membership-scheme/1.0.5/kubernetes-membership-scheme-1.0.5.jar ${WSO2_SERVER_HOME}/dropins + +# set the user and work directory +USER ${USER_ID} +WORKDIR ${USER_HOME} + +# set environment variables +ENV WSO2_SERVER_HOME=${WSO2_SERVER_HOME} \ + WORKING_DIRECTORY=${USER_HOME} \ + JAVA_OPTS="-Djava.util.prefs.systemRoot=${USER_HOME}/.java -Djava.util.prefs.userRoot=${USER_HOME}/.java/.userPrefs" # expose micro-integrator ports EXPOSE 8290 8253 diff --git a/dockerfiles/ubuntu/micro-integrator/files/.gitkeep b/dockerfiles/ubuntu/micro-integrator/files/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/dockerfiles/ubuntu/micro-integrator/init.sh b/dockerfiles/ubuntu/micro-integrator/init.sh index 803090ee..494db16f 100755 --- a/dockerfiles/ubuntu/micro-integrator/init.sh +++ b/dockerfiles/ubuntu/micro-integrator/init.sh @@ -35,4 +35,4 @@ test -d ${config_volume}/ && cp -RL ${config_volume}/* ${WSO2_SERVER_HOME}/ test -d ${artifact_volume}/ && cp -RL ${artifact_volume}/* ${WSO2_SERVER_HOME}/ # start WSO2 Carbon server -sh ${WSO2_SERVER_HOME}/bin/micro-integrator.sh +sh ${WSO2_SERVER_HOME}/bin/micro-integrator.sh "$@" diff --git a/dockerfiles/ubuntu/msf4j/Dockerfile b/dockerfiles/ubuntu/msf4j/Dockerfile index 52505b07..2fb86f31 100644 --- a/dockerfiles/ubuntu/msf4j/Dockerfile +++ b/dockerfiles/ubuntu/msf4j/Dockerfile @@ -1,6 +1,6 @@ # ------------------------------------------------------------------------ # -# Copyright 2018 WSO2, Inc. (http://wso2.com) +# Copyright 2017 WSO2, Inc. (http://wso2.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,11 +16,58 @@ # # ------------------------------------------------------------------------ -# set to product base image -FROM wso2ei-base:6.4.0 +# set base Docker image to AdoptOpenJDK Ubuntu Docker image +FROM adoptopenjdk/openjdk8:jdk8u192-b12 +MAINTAINER WSO2 Docker Maintainers "dev@wso2.org" +# set user configurations +ARG USER=wso2carbon +ARG USER_ID=802 +ARG USER_GROUP=wso2 +ARG USER_GROUP_ID=802 +ARG USER_HOME=/home/${USER} +# set dependant files directory +ARG FILES=./files +# set wso2 product configurations +ARG WSO2_SERVER=wso2ei +ARG WSO2_SERVER_VERSION=6.4.0 +ARG WSO2_SERVER_PACK=${WSO2_SERVER}-${WSO2_SERVER_VERSION} +ARG WSO2_SERVER_HOME=${USER_HOME}/${WSO2_SERVER_PACK} +# set WSO2 EULA +ARG MOTD="\n\ +Welcome to WSO2 Docker resources.\n\ +------------------------------------ \n\ +This Docker container comprises of a WSO2 product, running with its latest GA release \n\ +which is under the Apache License, Version 2.0. \n\ +Read more about Apache License, Version 2.0 here @ http://www.apache.org/licenses/LICENSE-2.0.\n" + +# install required packages +RUN apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + curl \ + netcat && \ + rm -rf /var/lib/apt/lists/* && \ + echo '[ ! -z "$TERM" -a -r /etc/motd ] && cat /etc/motd' \ + >> /etc/bash.bashrc \ + ; echo "$MOTD" > /etc/motd + +# create a user group and a user +RUN groupadd --system -g ${USER_GROUP_ID} ${USER_GROUP} && \ + useradd --system --create-home --home-dir ${USER_HOME} --no-log-init -g ${USER_GROUP_ID} -u ${USER_ID} ${USER} + +# copy wso2 product distribution to user's home directory and copy mysql connector jar to product distribution +COPY --chown=wso2carbon:wso2 ${FILES}/${WSO2_SERVER_PACK} ${WSO2_SERVER_HOME} +COPY --chown=wso2carbon:wso2 ${FILES}/mysql-connector-java-*-bin.jar ${WSO2_SERVER_HOME}/lib # copy entrypoint bash script to user home -COPY --chown=wso2carbon:wso2 init.sh ${WORKING_DIRECTORY}/ +COPY --chown=wso2carbon:wso2 init.sh ${USER_HOME}/ + +# set the user and work directory +USER ${USER_ID} +WORKDIR ${USER_HOME} + +# set environment variables +ENV WSO2_SERVER_HOME=${WSO2_SERVER_HOME} \ + WORKING_DIRECTORY=${USER_HOME} # expose msf4j ports EXPOSE 9090 diff --git a/dockerfiles/ubuntu/msf4j/files/.gitkeep b/dockerfiles/ubuntu/msf4j/files/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/dockerfiles/ubuntu/msf4j/init.sh b/dockerfiles/ubuntu/msf4j/init.sh index ffe9320f..33894f8e 100755 --- a/dockerfiles/ubuntu/msf4j/init.sh +++ b/dockerfiles/ubuntu/msf4j/init.sh @@ -35,4 +35,4 @@ test -d ${config_volume}/ && cp -RL ${config_volume}/* ${WSO2_SERVER_HOME}/ test -d ${artifact_volume}/ && cp -RL ${artifact_volume}/* ${WSO2_SERVER_HOME}/ # start WSO2 Carbon server -sh ${WSO2_SERVER_HOME}/bin/msf4j.sh +sh ${WSO2_SERVER_HOME}/bin/msf4j.sh "$@" From ab46d063d6dd28ed69a4eff6a28409ab922686c6 Mon Sep 17 00:00:00 2001 From: chirangaalwis Date: Thu, 10 Jan 2019 20:17:33 +0530 Subject: [PATCH 3/4] Integrate the usage of AdoptOpenJDK 8 to Alpine and CentOS based Docker resources, add support for passing arguments to Docker images and optimize Docker images --- dockerfiles/alpine/analytics/base/Dockerfile | 67 +++++++++++++++ .../{dashboard => base}/files/.gitkeep | 0 .../alpine/analytics/dashboard/Dockerfile | 6 +- .../alpine/analytics/dashboard/init.sh | 3 +- .../alpine/analytics/worker/Dockerfile | 6 +- dockerfiles/alpine/analytics/worker/init.sh | 3 +- dockerfiles/alpine/base/Dockerfile | 82 ------------------- dockerfiles/alpine/broker/Dockerfile | 67 +++++++++++++-- .../worker => broker}/files/.gitkeep | 0 dockerfiles/alpine/broker/init.sh | 17 +--- .../alpine/business-process/Dockerfile | 67 +++++++++++++-- .../{base => business-process}/files/.gitkeep | 0 dockerfiles/alpine/business-process/init.sh | 17 +--- dockerfiles/alpine/integrator/Dockerfile | 71 ++++++++++++++-- dockerfiles/alpine/integrator/init.sh | 2 +- .../alpine/micro-integrator/Dockerfile | 54 +++++++++++- .../micro-integrator}/files/.gitkeep | 0 dockerfiles/alpine/micro-integrator/init.sh | 2 +- dockerfiles/alpine/msf4j/Dockerfile | 54 +++++++++++- .../worker => alpine/msf4j}/files/.gitkeep | 0 dockerfiles/alpine/msf4j/init.sh | 2 +- .../centos/{ => analytics}/base/Dockerfile | 32 ++++---- .../{ => analytics}/base/files/.gitkeep | 0 .../centos/analytics/dashboard/Dockerfile | 6 +- .../centos/analytics/dashboard/init.sh | 2 +- .../centos/analytics/worker/Dockerfile | 6 +- dockerfiles/centos/analytics/worker/init.sh | 2 +- dockerfiles/centos/broker/Dockerfile | 63 ++++++++++++-- dockerfiles/centos/broker/files/.gitkeep | 0 dockerfiles/centos/broker/init.sh | 17 +--- .../centos/business-process/Dockerfile | 63 ++++++++++++-- .../centos/business-process/files/.gitkeep | 0 dockerfiles/centos/business-process/init.sh | 17 +--- dockerfiles/centos/integrator/Dockerfile | 64 +++++++++++++-- dockerfiles/centos/integrator/init.sh | 2 +- .../centos/micro-integrator/Dockerfile | 58 ++++++++++++- .../centos/micro-integrator/files/.gitkeep | 0 dockerfiles/centos/micro-integrator/init.sh | 2 +- dockerfiles/centos/msf4j/Dockerfile | 56 ++++++++++++- dockerfiles/centos/msf4j/files/.gitkeep | 0 dockerfiles/centos/msf4j/init.sh | 2 +- .../ubuntu/analytics/dashboard/Dockerfile | 3 - .../ubuntu/analytics/worker/Dockerfile | 3 - dockerfiles/ubuntu/business-process/init.sh | 15 ---- dockerfiles/ubuntu/integrator/Dockerfile | 11 +-- .../ubuntu/micro-integrator/Dockerfile | 13 +-- dockerfiles/ubuntu/msf4j/Dockerfile | 5 +- 47 files changed, 678 insertions(+), 284 deletions(-) create mode 100644 dockerfiles/alpine/analytics/base/Dockerfile rename dockerfiles/alpine/analytics/{dashboard => base}/files/.gitkeep (100%) delete mode 100644 dockerfiles/alpine/base/Dockerfile rename dockerfiles/alpine/{analytics/worker => broker}/files/.gitkeep (100%) rename dockerfiles/alpine/{base => business-process}/files/.gitkeep (100%) rename dockerfiles/{centos/analytics/dashboard => alpine/micro-integrator}/files/.gitkeep (100%) rename dockerfiles/{centos/analytics/worker => alpine/msf4j}/files/.gitkeep (100%) rename dockerfiles/centos/{ => analytics}/base/Dockerfile (62%) rename dockerfiles/centos/{ => analytics}/base/files/.gitkeep (100%) create mode 100644 dockerfiles/centos/broker/files/.gitkeep create mode 100644 dockerfiles/centos/business-process/files/.gitkeep create mode 100644 dockerfiles/centos/micro-integrator/files/.gitkeep create mode 100644 dockerfiles/centos/msf4j/files/.gitkeep diff --git a/dockerfiles/alpine/analytics/base/Dockerfile b/dockerfiles/alpine/analytics/base/Dockerfile new file mode 100644 index 00000000..75be0893 --- /dev/null +++ b/dockerfiles/alpine/analytics/base/Dockerfile @@ -0,0 +1,67 @@ +# ------------------------------------------------------------------------ +# +# Copyright 2018 WSO2, Inc. (http://wso2.com) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License +# +# ------------------------------------------------------------------------ + +# set base Docker image to AdoptOpenJDK Alpine Docker image +FROM adoptopenjdk/openjdk8:jdk8u192-b12-alpine +MAINTAINER WSO2 Docker Maintainers "dev@wso2.org" + +# set user configurations +ARG USER=wso2carbon +ARG USER_ID=802 +ARG USER_GROUP=wso2 +ARG USER_GROUP_ID=802 +ARG USER_HOME=/home/${USER} +# set dependant files directory +ARG FILES=./files +# set wso2 product configurations +ARG WSO2_SERVER=wso2ei +ARG WSO2_SERVER_VERSION=6.4.0 +ARG WSO2_SERVER_PACK=${WSO2_SERVER}-${WSO2_SERVER_VERSION} +ARG WSO2_SERVER_HOME=${USER_HOME}/${WSO2_SERVER_PACK} +ENV ENV=${USER_HOME}"/.ashrc" + +# set WSO2 EULA +ARG MOTD="\n\ +Welcome to WSO2 Docker resources.\n\ +------------------------------------ \n\ +This Docker container comprises of a WSO2 product, running with its latest GA release \n\ +which is under the Apache License, Version 2.0. \n\ +Read more about Apache License, Version 2.0 here @ http://www.apache.org/licenses/LICENSE-2.0.\n" + +# install required packages +RUN apk add --update --no-cache netcat-openbsd && \ + rm -rf /var/cache/apk/* + +# create a user group and a user +RUN addgroup -g ${USER_GROUP_ID} ${USER_GROUP}; \ + adduser -u ${USER_ID} -D -g '' -h ${USER_HOME} -G ${USER_GROUP} ${USER} ; + +# MOTD login message +RUN echo $MOTD > "$ENV" + +# copy wso2 product distribution to user's home directory and copy mysql connector jar to product distribution +COPY --chown=wso2carbon:wso2 ${FILES}/${WSO2_SERVER_PACK} ${WSO2_SERVER_HOME} +COPY --chown=wso2carbon:wso2 ${FILES}/mysql-connector-java-*-bin.jar ${WSO2_SERVER_HOME}/wso2/analytics/lib/ + +# set the user and work directory +USER ${USER_ID} +WORKDIR ${USER_HOME} + +# set environment variables +ENV WSO2_SERVER_HOME=${WSO2_SERVER_HOME} \ + WORKING_DIRECTORY=${USER_HOME} diff --git a/dockerfiles/alpine/analytics/dashboard/files/.gitkeep b/dockerfiles/alpine/analytics/base/files/.gitkeep similarity index 100% rename from dockerfiles/alpine/analytics/dashboard/files/.gitkeep rename to dockerfiles/alpine/analytics/base/files/.gitkeep diff --git a/dockerfiles/alpine/analytics/dashboard/Dockerfile b/dockerfiles/alpine/analytics/dashboard/Dockerfile index 6609a02a..7947a5e1 100644 --- a/dockerfiles/alpine/analytics/dashboard/Dockerfile +++ b/dockerfiles/alpine/analytics/dashboard/Dockerfile @@ -17,15 +17,13 @@ # ------------------------------------------------------------------------ # set to product base image -FROM wso2ei-base:6.4.0-alpine -ARG FILES=./files +FROM wso2ei-analytics-base:6.4.0-alpine # copy entrypoint bash script to user home COPY --chown=wso2carbon:wso2 init.sh ${WORKING_DIRECTORY}/ -COPY --chown=wso2carbon:wso2 ${FILES}/mysql-connector-java-*-bin.jar ${WSO2_SERVER_HOME}/wso2/analytics/lib/ # expose analytics ports -EXPOSE 9444 7612 7712 9161 +EXPOSE 9713 9643 9613 7713 7613 # set entrypoint to init script ENTRYPOINT ["/home/wso2carbon/init.sh"] diff --git a/dockerfiles/alpine/analytics/dashboard/init.sh b/dockerfiles/alpine/analytics/dashboard/init.sh index 09fb2a75..df43b0b5 100755 --- a/dockerfiles/alpine/analytics/dashboard/init.sh +++ b/dockerfiles/alpine/analytics/dashboard/init.sh @@ -14,6 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License # ------------------------------------------------------------------------ + set -e # volume mounts @@ -65,4 +66,4 @@ test -d ${config_volume}/ && cp -RL ${config_volume}/* ${WSO2_SERVER_HOME}/ test -d ${artifact_volume}/ && cp -RL ${artifact_volume}/* ${WSO2_SERVER_HOME}/ # start WSO2 Carbon server -sh ${WSO2_SERVER_HOME}/bin/analytics-dashboard.sh +sh ${WSO2_SERVER_HOME}/bin/analytics-dashboard.sh "$@" diff --git a/dockerfiles/alpine/analytics/worker/Dockerfile b/dockerfiles/alpine/analytics/worker/Dockerfile index 6609a02a..9e2e76d3 100644 --- a/dockerfiles/alpine/analytics/worker/Dockerfile +++ b/dockerfiles/alpine/analytics/worker/Dockerfile @@ -17,15 +17,13 @@ # ------------------------------------------------------------------------ # set to product base image -FROM wso2ei-base:6.4.0-alpine -ARG FILES=./files +FROM wso2ei-analytics-base:6.4.0-alpine # copy entrypoint bash script to user home COPY --chown=wso2carbon:wso2 init.sh ${WORKING_DIRECTORY}/ -COPY --chown=wso2carbon:wso2 ${FILES}/mysql-connector-java-*-bin.jar ${WSO2_SERVER_HOME}/wso2/analytics/lib/ # expose analytics ports -EXPOSE 9444 7612 7712 9161 +EXPOSE 9091 9444 9712 9612 7712 7612 7070 7443 # set entrypoint to init script ENTRYPOINT ["/home/wso2carbon/init.sh"] diff --git a/dockerfiles/alpine/analytics/worker/init.sh b/dockerfiles/alpine/analytics/worker/init.sh index e9d10b64..6875d68e 100755 --- a/dockerfiles/alpine/analytics/worker/init.sh +++ b/dockerfiles/alpine/analytics/worker/init.sh @@ -14,6 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License # ------------------------------------------------------------------------ + set -e # volume mounts @@ -65,4 +66,4 @@ test -d ${config_volume}/ && cp -RL ${config_volume}/* ${WSO2_SERVER_HOME}/ test -d ${artifact_volume}/ && cp -RL ${artifact_volume}/* ${WSO2_SERVER_HOME}/ # start WSO2 Carbon server -sh ${WSO2_SERVER_HOME}/bin/analytics-worker.sh +sh ${WSO2_SERVER_HOME}/bin/analytics-worker.sh "$@" diff --git a/dockerfiles/alpine/base/Dockerfile b/dockerfiles/alpine/base/Dockerfile deleted file mode 100644 index 9bfed59b..00000000 --- a/dockerfiles/alpine/base/Dockerfile +++ /dev/null @@ -1,82 +0,0 @@ -# ------------------------------------------------------------------------ -# -# Copyright 2018 WSO2, Inc. (http://wso2.com) -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License -# -# ------------------------------------------------------------------------ - -# set to latest Alpine -FROM openjdk:8u171-jdk-alpine3.8 -MAINTAINER WSO2 Docker Maintainers "dev@wso2.org” - -# set user configurations -ARG USER=wso2carbon -ARG USER_ID=802 -ARG USER_GROUP=wso2 -ARG USER_GROUP_ID=802 -ARG USER_HOME=/home/${USER} -# set dependant files directory -ARG FILES=./files -# set wso2 product configurations -ARG WSO2_SERVER=wso2ei -ARG WSO2_SERVER_VERSION=6.4.0 -ARG WSO2_SERVER_PACK=${WSO2_SERVER}-${WSO2_SERVER_VERSION} -ARG WSO2_SERVER_HOME=${USER_HOME}/${WSO2_SERVER_PACK} -ENV ENV=${USER_HOME}"/.ashrc" - -# install required packages -RUN apk add --update --no-cache \ - curl \ - netcat-openbsd && \ - rm -rf /var/cache/apk/* - -# create a user group and a user -RUN addgroup -g ${USER_GROUP_ID} ${USER_GROUP}; \ - adduser -u ${USER_ID} -D -g '' -h ${USER_HOME} -G ${USER_GROUP} ${USER} ; - -# MOTD login message -RUN echo 'printf "Welcome to WSO2 Docker resources.\n\ -----------------------------------\n\ -The Docker container contains the WSO2 product with its latest updates,\n\ -which are under the End User License Agreement (EULA) 2.0.\n\ -Read more about EULA 2.0 (https://wso2.com/licenses/wso2-update/2.0).\n"' > "$ENV" - -# create java prefs dir -# this is to avoid warning logs printed by FileSystemPreferences class -RUN mkdir -p ${USER_HOME}/.java/.systemPrefs && \ - mkdir -p ${USER_HOME}/.java/.userPrefs && \ - chmod -R 755 ${USER_HOME}/.java && \ - chown -R ${USER}:${USER_GROUP} ${USER_HOME}/.java - -# Install Alpine Linux package to run binaries linked against glibc -RUN apk --no-cache add ca-certificates wget; \ - wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub; \ - wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.27-r0/glibc-2.27-r0.apk; \ - apk add glibc-2.27-r0.apk; - -# copy jdk, wso2 product distribution to user's home directory and copy mysql connector jar to product distribution -COPY --chown=wso2carbon:wso2 ${FILES}/${WSO2_SERVER_PACK} ${WSO2_SERVER_HOME} -COPY --chown=wso2carbon:wso2 ${FILES}/mysql-connector-java-*-bin.jar ${WSO2_SERVER_HOME}/lib -# add libraries for Kubernetes membership scheme based clustering -ADD --chown=wso2carbon:wso2 https://repo1.maven.org/maven2/dnsjava/dnsjava/2.1.8/dnsjava-2.1.8.jar ${WSO2_SERVER_HOME}/lib -ADD --chown=wso2carbon:wso2 https://repo1.maven.org/maven2/org/wso2/carbon/kubernetes/artifacts/kubernetes-membership-scheme/1.0.5/kubernetes-membership-scheme-1.0.5.jar ${WSO2_SERVER_HOME}/dropins - -# set environment variables -ENV JAVA_OPTS="-Djava.util.prefs.systemRoot=${USER_HOME}/.java -Djava.util.prefs.userRoot=${USER_HOME}/.java/.userPrefs" \ - WORKING_DIRECTORY=${USER_HOME} \ - WSO2_SERVER_HOME=${WSO2_SERVER_HOME} - -# set the user and work directory -USER ${USER_ID} -WORKDIR ${USER_HOME} diff --git a/dockerfiles/alpine/broker/Dockerfile b/dockerfiles/alpine/broker/Dockerfile index 3d80a608..1a81aecd 100644 --- a/dockerfiles/alpine/broker/Dockerfile +++ b/dockerfiles/alpine/broker/Dockerfile @@ -16,15 +16,70 @@ # # ------------------------------------------------------------------------ -# set to product base image -FROM wso2ei-base:6.4.0-alpine +# set base Docker image to AdoptOpenJDK Alpine Docker image +FROM adoptopenjdk/openjdk8:jdk8u192-b12-alpine +MAINTAINER WSO2 Docker Maintainers "dev@wso2.org" +# set user configurations +ARG USER=wso2carbon +ARG USER_ID=802 +ARG USER_GROUP=wso2 +ARG USER_GROUP_ID=802 +ARG USER_HOME=/home/${USER} +# set dependant files directory +ARG FILES=./files +# set wso2 product configurations +ARG WSO2_SERVER=wso2ei +ARG WSO2_SERVER_VERSION=6.4.0 +ARG WSO2_SERVER_PACK=${WSO2_SERVER}-${WSO2_SERVER_VERSION} +ARG WSO2_SERVER_HOME=${USER_HOME}/${WSO2_SERVER_PACK} +ENV ENV=${USER_HOME}"/.ashrc" + +# set WSO2 EULA +ARG MOTD="\n\ +Welcome to WSO2 Docker resources.\n\ +------------------------------------ \n\ +This Docker container comprises of a WSO2 product, running with its latest GA release \n\ +which is under the Apache License, Version 2.0. \n\ +Read more about Apache License, Version 2.0 here @ http://www.apache.org/licenses/LICENSE-2.0.\n" + +# install required packages +RUN apk add --update --no-cache \ + curl \ + netcat-openbsd && \ + rm -rf /var/cache/apk/* + +# create a user group and a user +RUN addgroup -g ${USER_GROUP_ID} ${USER_GROUP}; \ + adduser -u ${USER_ID} -D -g '' -h ${USER_HOME} -G ${USER_GROUP} ${USER} ; + +# MOTD login message +RUN echo $MOTD > "$ENV" + +# create java prefs dir +# this is to avoid warning logs printed by FileSystemPreferences class +RUN mkdir -p ${USER_HOME}/.java/.systemPrefs && \ + mkdir -p ${USER_HOME}/.java/.userPrefs && \ + chmod -R 755 ${USER_HOME}/.java && \ + chown -R ${USER}:${USER_GROUP} ${USER_HOME}/.java + +# copy wso2 product distribution to user's home directory and copy mysql connector jar to product distribution +COPY --chown=wso2carbon:wso2 ${FILES}/${WSO2_SERVER_PACK} ${WSO2_SERVER_HOME} +COPY --chown=wso2carbon:wso2 ${FILES}/mysql-connector-java-*-bin.jar ${WSO2_SERVER_HOME}/lib # copy entrypoint bash script to user home -COPY --chown=wso2carbon:wso2 init.sh ${WORKING_DIRECTORY}/ +COPY --chown=wso2carbon:wso2 init.sh ${USER_HOME}/ +# add libraries for Kubernetes membership scheme based clustering +ADD --chown=wso2carbon:wso2 https://repo1.maven.org/maven2/dnsjava/dnsjava/2.1.8/dnsjava-2.1.8.jar ${WSO2_SERVER_HOME}/lib +ADD --chown=wso2carbon:wso2 https://repo1.maven.org/maven2/org/wso2/carbon/kubernetes/artifacts/kubernetes-membership-scheme/1.0.5/kubernetes-membership-scheme-1.0.5.jar ${WSO2_SERVER_HOME}/dropins + +# set the user and work directory +USER ${USER_ID} +WORKDIR ${USER_HOME} -# set temporary location for shared artifacts -RUN mkdir -p ${WORKING_DIRECTORY}/wso2-tmp/ && \ - cp -r ${WSO2_SERVER_HOME}/wso2/broker/repository/deployment/ ${WORKING_DIRECTORY}/wso2-tmp/deployment/ +# set environment variables +ENV WSO2_SERVER_HOME=${WSO2_SERVER_HOME} \ + WORKING_DIRECTORY=${USER_HOME} \ + JAVA_OPTS="-Djava.util.prefs.systemRoot=${USER_HOME}/.java -Djava.util.prefs.userRoot=${USER_HOME}/.java/.userPrefs" # expose broker ports EXPOSE 9446 9766 5675 8675 1886 8836 7614 4000 diff --git a/dockerfiles/alpine/analytics/worker/files/.gitkeep b/dockerfiles/alpine/broker/files/.gitkeep similarity index 100% rename from dockerfiles/alpine/analytics/worker/files/.gitkeep rename to dockerfiles/alpine/broker/files/.gitkeep diff --git a/dockerfiles/alpine/broker/init.sh b/dockerfiles/alpine/broker/init.sh index a66992c3..47420685 100755 --- a/dockerfiles/alpine/broker/init.sh +++ b/dockerfiles/alpine/broker/init.sh @@ -22,10 +22,6 @@ server_profile=broker # volume mounts config_volume=${WORKING_DIRECTORY}/wso2-config-volume artifact_volume=${WORKING_DIRECTORY}/wso2-artifact-volume -deployment_volume=${WSO2_SERVER_HOME}/wso2/${server_profile}/repository/deployment - -# original deployment artifacts -original_deployment_artifacts=${WORKING_DIRECTORY}/wso2-tmp/deployment # a grace period for mounts to be setup echo "Waiting for all volumes to be mounted..." @@ -69,17 +65,6 @@ test ! -d ${WORKING_DIRECTORY} && echo "WSO2 Docker non-root user home does not # check if the WSO2 product home exists test ! -d ${WSO2_SERVER_HOME} && echo "WSO2 Docker product home does not exist" && exit 1 -# if a deployment_volume is present and empty, copy original deployment artifacts to server... -# copying original artifacts to ${WORKING_DIRECTORY}/wso2-tmp/deployment was already done in the Dockerfile -# these artifacts will be copied to deployment_volume if it is empty, before the server is started -if test -d ${original_deployment_artifacts}; then - if [ -z "$(ls -A ${deployment_volume}/)" ]; then - # if no artifact is found under /wso2/broker/repository/deployment; copy originals - echo "Copying original deployment artifacts from temporary location to server..." - cp -R ${original_deployment_artifacts}/* ${deployment_volume}/ - fi -fi - # copy any configuration changes mounted to config_volume test -d ${config_volume}/ && cp -RL ${config_volume}/* ${WSO2_SERVER_HOME}/ # copy any artifact changes mounted to artifact_volume @@ -92,4 +77,4 @@ sed -i "s##.*#${docker_container_ip}#" ${WSO2_SERVER_HOME}/wso2/${server_profile}/conf/broker.xml # start WSO2 Carbon server -sh ${WSO2_SERVER_HOME}/bin/${server_profile}.sh +sh ${WSO2_SERVER_HOME}/bin/${server_profile}.sh "$@" diff --git a/dockerfiles/alpine/business-process/Dockerfile b/dockerfiles/alpine/business-process/Dockerfile index 9cc5e359..5c0d824a 100644 --- a/dockerfiles/alpine/business-process/Dockerfile +++ b/dockerfiles/alpine/business-process/Dockerfile @@ -16,15 +16,70 @@ # # ------------------------------------------------------------------------ -# set to product base image -FROM wso2ei-base:6.4.0-alpine +# set base Docker image to AdoptOpenJDK Alpine Docker image +FROM adoptopenjdk/openjdk8:jdk8u192-b12-alpine +MAINTAINER WSO2 Docker Maintainers "dev@wso2.org" +# set user configurations +ARG USER=wso2carbon +ARG USER_ID=802 +ARG USER_GROUP=wso2 +ARG USER_GROUP_ID=802 +ARG USER_HOME=/home/${USER} +# set dependant files directory +ARG FILES=./files +# set wso2 product configurations +ARG WSO2_SERVER=wso2ei +ARG WSO2_SERVER_VERSION=6.4.0 +ARG WSO2_SERVER_PACK=${WSO2_SERVER}-${WSO2_SERVER_VERSION} +ARG WSO2_SERVER_HOME=${USER_HOME}/${WSO2_SERVER_PACK} +ENV ENV=${USER_HOME}"/.ashrc" + +# set WSO2 EULA +ARG MOTD="\n\ +Welcome to WSO2 Docker resources.\n\ +------------------------------------ \n\ +This Docker container comprises of a WSO2 product, running with its latest GA release \n\ +which is under the Apache License, Version 2.0. \n\ +Read more about Apache License, Version 2.0 here @ http://www.apache.org/licenses/LICENSE-2.0.\n" + +# install required packages +RUN apk add --update --no-cache \ + curl \ + netcat-openbsd && \ + rm -rf /var/cache/apk/* + +# create a user group and a user +RUN addgroup -g ${USER_GROUP_ID} ${USER_GROUP}; \ + adduser -u ${USER_ID} -D -g '' -h ${USER_HOME} -G ${USER_GROUP} ${USER} ; + +# MOTD login message +RUN echo $MOTD > "$ENV" + +# create java prefs dir +# this is to avoid warning logs printed by FileSystemPreferences class +RUN mkdir -p ${USER_HOME}/.java/.systemPrefs && \ + mkdir -p ${USER_HOME}/.java/.userPrefs && \ + chmod -R 755 ${USER_HOME}/.java && \ + chown -R ${USER}:${USER_GROUP} ${USER_HOME}/.java + +# copy wso2 product distribution to user's home directory and copy mysql connector jar to product distribution +COPY --chown=wso2carbon:wso2 ${FILES}/${WSO2_SERVER_PACK} ${WSO2_SERVER_HOME} +COPY --chown=wso2carbon:wso2 ${FILES}/mysql-connector-java-*-bin.jar ${WSO2_SERVER_HOME}/lib # copy entrypoint bash script to user home -COPY --chown=wso2carbon:wso2 init.sh ${WORKING_DIRECTORY}/ +COPY --chown=wso2carbon:wso2 init.sh ${USER_HOME}/ +# add libraries for Kubernetes membership scheme based clustering +ADD --chown=wso2carbon:wso2 https://repo1.maven.org/maven2/dnsjava/dnsjava/2.1.8/dnsjava-2.1.8.jar ${WSO2_SERVER_HOME}/lib +ADD --chown=wso2carbon:wso2 https://repo1.maven.org/maven2/org/wso2/carbon/kubernetes/artifacts/kubernetes-membership-scheme/1.0.5/kubernetes-membership-scheme-1.0.5.jar ${WSO2_SERVER_HOME}/dropins + +# set the user and work directory +USER ${USER_ID} +WORKDIR ${USER_HOME} -# set temporary location for shared artifacts -RUN mkdir -p ${WORKING_DIRECTORY}/wso2-tmp/ && \ - cp -r ${WSO2_SERVER_HOME}/wso2/business-process/repository/deployment/server/ ${WORKING_DIRECTORY}/wso2-tmp/server/ +# set environment variables +ENV WSO2_SERVER_HOME=${WSO2_SERVER_HOME} \ + WORKING_DIRECTORY=${USER_HOME} \ + JAVA_OPTS="-Djava.util.prefs.systemRoot=${USER_HOME}/.java -Djava.util.prefs.userRoot=${USER_HOME}/.java/.userPrefs" # expose business-process ports EXPOSE 9445 9765 4000 diff --git a/dockerfiles/alpine/base/files/.gitkeep b/dockerfiles/alpine/business-process/files/.gitkeep similarity index 100% rename from dockerfiles/alpine/base/files/.gitkeep rename to dockerfiles/alpine/business-process/files/.gitkeep diff --git a/dockerfiles/alpine/business-process/init.sh b/dockerfiles/alpine/business-process/init.sh index 0ec36450..336e5b57 100755 --- a/dockerfiles/alpine/business-process/init.sh +++ b/dockerfiles/alpine/business-process/init.sh @@ -22,10 +22,6 @@ server_profile=business-process # volume mounts config_volume=${WORKING_DIRECTORY}/wso2-config-volume artifact_volume=${WORKING_DIRECTORY}/wso2-artifact-volume -deployment_volume=${WSO2_SERVER_HOME}/wso2/${server_profile}/repository/deployment/server - -# original deployment artifacts -original_deployment_artifacts=${WORKING_DIRECTORY}/wso2-tmp/server # a grace period for mounts to be setup echo "Waiting for all volumes to be mounted..." @@ -69,17 +65,6 @@ test ! -d ${WORKING_DIRECTORY} && echo "WSO2 Docker non-root user home does not # check if the WSO2 product home exists test ! -d ${WSO2_SERVER_HOME} && echo "WSO2 Docker product home does not exist" && exit 1 -# if a deployment_volume is present and empty, copy original deployment artifacts to server... -# copying original artifacts to ${WORKING_DIRECTORY}/wso2-tmp/server was already done in the Dockerfile -# these artifacts will be copied to deployment_volume if it is empty, before the server is started -if test -d ${original_deployment_artifacts}; then - if [ -z "$(ls -A ${deployment_volume}/)" ]; then - # if no artifact is found under /wso2/business-process/repository/deployment/server; copy originals - echo "Copying original deployment artifacts from temporary location to server..." - cp -R ${original_deployment_artifacts}/* ${deployment_volume}/ - fi -fi - # copy any configuration changes mounted to config_volume test -d ${config_volume}/ && cp -RL ${config_volume}/* ${WSO2_SERVER_HOME}/ # copy any artifact changes mounted to artifact_volume @@ -92,4 +77,4 @@ sed -i "s##.*<\/tns:NodeId>#${docker_container_ip}<\/tns:NodeId>#" ${WSO2_SERVER_HOME}/wso2/${server_profile}/conf/bps.xml # start WSO2 Carbon server -sh ${WSO2_SERVER_HOME}/bin/${server_profile}.sh +sh ${WSO2_SERVER_HOME}/bin/${server_profile}.sh "$@" diff --git a/dockerfiles/alpine/integrator/Dockerfile b/dockerfiles/alpine/integrator/Dockerfile index 085de05d..3262ca2b 100644 --- a/dockerfiles/alpine/integrator/Dockerfile +++ b/dockerfiles/alpine/integrator/Dockerfile @@ -16,19 +16,74 @@ # # ------------------------------------------------------------------------ -# set to product base image -FROM wso2ei-base:6.4.0-alpine +# set base Docker image to AdoptOpenJDK Alpine Docker image +FROM adoptopenjdk/openjdk8:jdk8u192-b12-alpine +MAINTAINER WSO2 Docker Maintainers "dev@wso2.org" +# set user configurations +ARG USER=wso2carbon +ARG USER_ID=802 +ARG USER_GROUP=wso2 +ARG USER_GROUP_ID=802 +ARG USER_HOME=/home/${USER} # set dependant files directory ARG FILES=./files +# set wso2 product configurations +ARG WSO2_SERVER=wso2ei +ARG WSO2_SERVER_VERSION=6.4.0 +ARG WSO2_SERVER_PACK=${WSO2_SERVER}-${WSO2_SERVER_VERSION} +ARG WSO2_SERVER_HOME=${USER_HOME}/${WSO2_SERVER_PACK} +ENV ENV=${USER_HOME}"/.ashrc" -# copy entrypoint bash script to user home and external libraries to product home -COPY --chown=wso2carbon:wso2 init.sh ${WORKING_DIRECTORY}/ -COPY --chown=wso2carbon:wso2 ${FILES} ${WSO2_SERVER_HOME}/lib +# set WSO2 EULA +ARG MOTD="\n\ +Welcome to WSO2 Docker resources.\n\ +------------------------------------ \n\ +This Docker container comprises of a WSO2 product, running with its latest GA release \n\ +which is under the Apache License, Version 2.0. \n\ +Read more about Apache License, Version 2.0 here @ http://www.apache.org/licenses/LICENSE-2.0.\n" -# set temporary location for shared artifacts -RUN mkdir -p ${WORKING_DIRECTORY}/wso2-tmp/ && \ - cp -r ${WSO2_SERVER_HOME}/repository/deployment/server/ ${WORKING_DIRECTORY}/wso2-tmp/server/ +# install required packages +RUN apk add --update --no-cache \ + curl \ + netcat-openbsd && \ + rm -rf /var/cache/apk/* + +# create a user group and a user +RUN addgroup -g ${USER_GROUP_ID} ${USER_GROUP}; \ + adduser -u ${USER_ID} -D -g '' -h ${USER_HOME} -G ${USER_GROUP} ${USER} ; + +# MOTD login message +RUN echo $MOTD > "$ENV" + +# create java prefs dir +# this is to avoid warning logs printed by FileSystemPreferences class +RUN mkdir -p ${USER_HOME}/.java/.systemPrefs && \ + mkdir -p ${USER_HOME}/.java/.userPrefs && \ + chmod -R 755 ${USER_HOME}/.java && \ + chown -R ${USER}:${USER_GROUP} ${USER_HOME}/.java + +# copy wso2 product distribution to user's home directory +COPY --chown=wso2carbon:wso2 ${FILES}/${WSO2_SERVER_PACK} ${WSO2_SERVER_HOME} +# copy shared artifacts to a temporary location +COPY --chown=wso2carbon:wso2 ${FILES}/${WSO2_SERVER_PACK}/repository/deployment/server/ ${USER_HOME}/wso2-tmp/server/ +# copy entrypoint bash script to user home +COPY --chown=wso2carbon:wso2 init.sh ${USER_HOME}/ +# copy relevant libraries (mysql connector jar and integrator libraries) to product distribution +COPY --chown=wso2carbon:wso2 ${FILES}/mysql-connector-java-*-bin.jar ${WSO2_SERVER_HOME}/lib/ +COPY --chown=wso2carbon:wso2 ${FILES}/lib ${WSO2_SERVER_HOME}/lib/ +# add libraries for Kubernetes membership scheme based clustering +ADD --chown=wso2carbon:wso2 https://repo1.maven.org/maven2/dnsjava/dnsjava/2.1.8/dnsjava-2.1.8.jar ${WSO2_SERVER_HOME}/lib +ADD --chown=wso2carbon:wso2 https://repo1.maven.org/maven2/org/wso2/carbon/kubernetes/artifacts/kubernetes-membership-scheme/1.0.5/kubernetes-membership-scheme-1.0.5.jar ${WSO2_SERVER_HOME}/dropins + +# set the user and work directory +USER ${USER_ID} +WORKDIR ${USER_HOME} + +# set environment variables +ENV WSO2_SERVER_HOME=${WSO2_SERVER_HOME} \ + WORKING_DIRECTORY=${USER_HOME} \ + JAVA_OPTS="-Djava.util.prefs.systemRoot=${USER_HOME}/.java -Djava.util.prefs.userRoot=${USER_HOME}/.java/.userPrefs" # expose integrator ports EXPOSE 8280 8243 9443 4100 diff --git a/dockerfiles/alpine/integrator/init.sh b/dockerfiles/alpine/integrator/init.sh index 93e4bc50..b5d902ac 100755 --- a/dockerfiles/alpine/integrator/init.sh +++ b/dockerfiles/alpine/integrator/init.sh @@ -87,4 +87,4 @@ test -d ${artifact_volume}/ && cp -RL ${artifact_volume}/* ${WSO2_SERVER_HOME}/ sed -i "s##${docker_container_ip}<\/parameter>#" ${WSO2_SERVER_HOME}/conf/axis2/axis2.xml # start WSO2 Carbon server -sh ${WSO2_SERVER_HOME}/bin/integrator.sh +sh ${WSO2_SERVER_HOME}/bin/integrator.sh "$@" diff --git a/dockerfiles/alpine/micro-integrator/Dockerfile b/dockerfiles/alpine/micro-integrator/Dockerfile index cf0e074a..07aebeeb 100644 --- a/dockerfiles/alpine/micro-integrator/Dockerfile +++ b/dockerfiles/alpine/micro-integrator/Dockerfile @@ -16,11 +16,59 @@ # # ------------------------------------------------------------------------ -# set to product base image -FROM wso2ei-base:6.4.0-alpine +# set base Docker image to AdoptOpenJDK Alpine Docker image +FROM adoptopenjdk/openjdk8:jdk8u192-b12-alpine +MAINTAINER WSO2 Docker Maintainers "dev@wso2.org" +# set user configurations +ARG USER=wso2carbon +ARG USER_ID=802 +ARG USER_GROUP=wso2 +ARG USER_GROUP_ID=802 +ARG USER_HOME=/home/${USER} +# set dependant files directory +ARG FILES=./files +# set wso2 product configurations +ARG WSO2_SERVER=wso2ei +ARG WSO2_SERVER_VERSION=6.4.0 +ARG WSO2_SERVER_PACK=${WSO2_SERVER}-${WSO2_SERVER_VERSION} +ARG WSO2_SERVER_HOME=${USER_HOME}/${WSO2_SERVER_PACK} +ENV ENV=${USER_HOME}"/.ashrc" + +# set WSO2 EULA +ARG MOTD="\n\ +Welcome to WSO2 Docker resources.\n\ +------------------------------------ \n\ +This Docker container comprises of a WSO2 product, running with its latest GA release \n\ +which is under the Apache License, Version 2.0. \n\ +Read more about Apache License, Version 2.0 here @ http://www.apache.org/licenses/LICENSE-2.0.\n" + +# install required packages +RUN apk add --update --no-cache \ + curl \ + netcat-openbsd && \ + rm -rf /var/cache/apk/* + +# create a user group and a user +RUN addgroup -g ${USER_GROUP_ID} ${USER_GROUP}; \ + adduser -u ${USER_ID} -D -g '' -h ${USER_HOME} -G ${USER_GROUP} ${USER} ; + +# MOTD login message +RUN echo $MOTD > "$ENV" + +# copy wso2 product distribution to user's home directory and copy mysql connector jar to product distribution +COPY --chown=wso2carbon:wso2 ${FILES}/${WSO2_SERVER_PACK} ${WSO2_SERVER_HOME} +COPY --chown=wso2carbon:wso2 ${FILES}/mysql-connector-java-*-bin.jar ${WSO2_SERVER_HOME}/lib # copy entrypoint bash script to user home -COPY --chown=wso2carbon:wso2 init.sh ${WORKING_DIRECTORY}/ +COPY --chown=wso2carbon:wso2 init.sh ${USER_HOME}/ + +# set the user and work directory +USER ${USER_ID} +WORKDIR ${USER_HOME} + +# set environment variables +ENV WSO2_SERVER_HOME=${WSO2_SERVER_HOME} \ + WORKING_DIRECTORY=${USER_HOME} # expose micro-integrator ports EXPOSE 8290 8253 diff --git a/dockerfiles/centos/analytics/dashboard/files/.gitkeep b/dockerfiles/alpine/micro-integrator/files/.gitkeep similarity index 100% rename from dockerfiles/centos/analytics/dashboard/files/.gitkeep rename to dockerfiles/alpine/micro-integrator/files/.gitkeep diff --git a/dockerfiles/alpine/micro-integrator/init.sh b/dockerfiles/alpine/micro-integrator/init.sh index 9389e94b..a7b6b35e 100755 --- a/dockerfiles/alpine/micro-integrator/init.sh +++ b/dockerfiles/alpine/micro-integrator/init.sh @@ -68,4 +68,4 @@ test -d ${config_volume}/ && cp -RL ${config_volume}/* ${WSO2_SERVER_HOME}/ test -d ${artifact_volume}/ && cp -RL ${artifact_volume}/* ${WSO2_SERVER_HOME}/ # start WSO2 Carbon server -sh ${WSO2_SERVER_HOME}/bin/micro-integrator.sh +sh ${WSO2_SERVER_HOME}/bin/micro-integrator.sh "$@" diff --git a/dockerfiles/alpine/msf4j/Dockerfile b/dockerfiles/alpine/msf4j/Dockerfile index 302e41a6..9689c8d0 100644 --- a/dockerfiles/alpine/msf4j/Dockerfile +++ b/dockerfiles/alpine/msf4j/Dockerfile @@ -16,11 +16,59 @@ # # ------------------------------------------------------------------------ -# set to product base image -FROM wso2ei-base:6.4.0-alpine +# set base Docker image to AdoptOpenJDK Alpine Docker image +FROM adoptopenjdk/openjdk8:jdk8u192-b12-alpine +MAINTAINER WSO2 Docker Maintainers "dev@wso2.org" +# set user configurations +ARG USER=wso2carbon +ARG USER_ID=802 +ARG USER_GROUP=wso2 +ARG USER_GROUP_ID=802 +ARG USER_HOME=/home/${USER} +# set dependant files directory +ARG FILES=./files +# set wso2 product configurations +ARG WSO2_SERVER=wso2ei +ARG WSO2_SERVER_VERSION=6.4.0 +ARG WSO2_SERVER_PACK=${WSO2_SERVER}-${WSO2_SERVER_VERSION} +ARG WSO2_SERVER_HOME=${USER_HOME}/${WSO2_SERVER_PACK} +ENV ENV=${USER_HOME}"/.ashrc" + +# set WSO2 EULA +ARG MOTD="\n\ +Welcome to WSO2 Docker resources.\n\ +------------------------------------ \n\ +This Docker container comprises of a WSO2 product, running with its latest GA release \n\ +which is under the Apache License, Version 2.0. \n\ +Read more about Apache License, Version 2.0 here @ http://www.apache.org/licenses/LICENSE-2.0.\n" + +# install required packages +RUN apk add --update --no-cache \ + curl \ + netcat-openbsd && \ + rm -rf /var/cache/apk/* + +# create a user group and a user +RUN addgroup -g ${USER_GROUP_ID} ${USER_GROUP}; \ + adduser -u ${USER_ID} -D -g '' -h ${USER_HOME} -G ${USER_GROUP} ${USER} ; + +# MOTD login message +RUN echo $MOTD > "$ENV" + +# copy wso2 product distribution to user's home directory and copy mysql connector jar to product distribution +COPY --chown=wso2carbon:wso2 ${FILES}/${WSO2_SERVER_PACK} ${WSO2_SERVER_HOME} +COPY --chown=wso2carbon:wso2 ${FILES}/mysql-connector-java-*-bin.jar ${WSO2_SERVER_HOME}/lib # copy entrypoint bash script to user home -COPY --chown=wso2carbon:wso2 init.sh ${WORKING_DIRECTORY}/ +COPY --chown=wso2carbon:wso2 init.sh ${USER_HOME}/ + +# set the user and work directory +USER ${USER_ID} +WORKDIR ${USER_HOME} + +# set environment variables +ENV WSO2_SERVER_HOME=${WSO2_SERVER_HOME} \ + WORKING_DIRECTORY=${USER_HOME} # expose msf4j ports EXPOSE 9090 diff --git a/dockerfiles/centos/analytics/worker/files/.gitkeep b/dockerfiles/alpine/msf4j/files/.gitkeep similarity index 100% rename from dockerfiles/centos/analytics/worker/files/.gitkeep rename to dockerfiles/alpine/msf4j/files/.gitkeep diff --git a/dockerfiles/alpine/msf4j/init.sh b/dockerfiles/alpine/msf4j/init.sh index ffe9320f..33894f8e 100755 --- a/dockerfiles/alpine/msf4j/init.sh +++ b/dockerfiles/alpine/msf4j/init.sh @@ -35,4 +35,4 @@ test -d ${config_volume}/ && cp -RL ${config_volume}/* ${WSO2_SERVER_HOME}/ test -d ${artifact_volume}/ && cp -RL ${artifact_volume}/* ${WSO2_SERVER_HOME}/ # start WSO2 Carbon server -sh ${WSO2_SERVER_HOME}/bin/msf4j.sh +sh ${WSO2_SERVER_HOME}/bin/msf4j.sh "$@" diff --git a/dockerfiles/centos/base/Dockerfile b/dockerfiles/centos/analytics/base/Dockerfile similarity index 62% rename from dockerfiles/centos/base/Dockerfile rename to dockerfiles/centos/analytics/base/Dockerfile index 7a23f43e..9ee6b2df 100644 --- a/dockerfiles/centos/base/Dockerfile +++ b/dockerfiles/centos/analytics/base/Dockerfile @@ -29,39 +29,39 @@ ARG USER_HOME=/home/${USER} # set dependant files directory ARG FILES=./files # set jdk configurations -ARG JDK=jdk1.8.0* +ARG JDK=jdk8u* ARG JAVA_HOME=${USER_HOME}/java # set wso2 product configurations ARG WSO2_SERVER=wso2ei ARG WSO2_SERVER_VERSION=6.4.0 ARG WSO2_SERVER_PACK=${WSO2_SERVER}-${WSO2_SERVER_VERSION} ARG WSO2_SERVER_HOME=${USER_HOME}/${WSO2_SERVER_PACK} +# set WSO2 EULA +ARG MOTD="\n\ +Welcome to WSO2 Docker resources.\n\ +------------------------------------ \n\ +This Docker container comprises of a WSO2 product, running with its latest GA release \n\ +which is under the Apache License, Version 2.0. \n\ +Read more about Apache License, Version 2.0 here @ http://www.apache.org/licenses/LICENSE-2.0.\n" # install required packages -RUN yum update -y && \ +RUN yum -y update && \ yum install -y nc && \ rm -rf /var/cache/yum/* && \ - echo 'printf "\n\ - Welcome to WSO2 Docker Resources \n\ - --------------------------------- \n\ - This Docker container comprises of a WSO2 product, running with its latest updates \n\ - which are under the End User License Agreement (EULA) 2.0. \n\ - Read more about EULA 2.0 here @ https://wso2.com/licenses/wso2-update/2.0 \n"' > /etc/profile.d/motd.sh + echo $MOTD > /etc/profile.d/motd.sh # create a user group and a user RUN groupadd --system -g ${USER_GROUP_ID} ${USER_GROUP} && \ useradd --system --create-home --home-dir ${USER_HOME} --no-log-init -g ${USER_GROUP_ID} -u ${USER_ID} ${USER} -# copy jdk, wso2 product distribution to user's home directory and copy mysql connector jar to product distribution -COPY --chown=wso2carbon:wso2 ${FILES}/${JDK} ${JAVA_HOME} -COPY --chown=wso2carbon:wso2 ${FILES}/${WSO2_SERVER_PACK} ${WSO2_SERVER_HOME} -COPY --chown=wso2carbon:wso2 ${FILES}/mysql-connector-java-*-bin.jar ${WSO2_SERVER_HOME}/lib -# add libraries for Kubernetes membership scheme based clustering -ADD --chown=wso2carbon:wso2 https://repo1.maven.org/maven2/dnsjava/dnsjava/2.1.8/dnsjava-2.1.8.jar ${WSO2_SERVER_HOME}/lib -ADD --chown=wso2carbon:wso2 https://repo1.maven.org/maven2/org/wso2/carbon/kubernetes/artifacts/kubernetes-membership-scheme/1.0.5/kubernetes-membership-scheme-1.0.5.jar ${WSO2_SERVER_HOME}/dropins +# copy the jdk and wso2 product distributions to user's home directory +COPY --chown=wso2carbon:wso2 ${FILES}/${JDK} ${USER_HOME}/java/ +COPY --chown=wso2carbon:wso2 ${FILES}/${WSO2_SERVER_PACK}/ ${WSO2_SERVER_HOME}/ +# copy mysql connector jar to the server as a third party library +COPY --chown=wso2carbon:wso2 ${FILES}/mysql-connector-java-*-bin.jar ${WSO2_SERVER_HOME}/wso2/analytics/lib/ # set the user and work directory -USER ${USER} +USER ${USER_ID} WORKDIR ${USER_HOME} # set environment variables diff --git a/dockerfiles/centos/base/files/.gitkeep b/dockerfiles/centos/analytics/base/files/.gitkeep similarity index 100% rename from dockerfiles/centos/base/files/.gitkeep rename to dockerfiles/centos/analytics/base/files/.gitkeep diff --git a/dockerfiles/centos/analytics/dashboard/Dockerfile b/dockerfiles/centos/analytics/dashboard/Dockerfile index 610c2ae3..d764d04f 100644 --- a/dockerfiles/centos/analytics/dashboard/Dockerfile +++ b/dockerfiles/centos/analytics/dashboard/Dockerfile @@ -17,15 +17,13 @@ # ------------------------------------------------------------------------ # set to product base image -FROM wso2ei-base:6.4.0-centos -ARG FILES=./files +FROM wso2ei-analytics-base:6.4.0-centos # copy entrypoint bash script to user home COPY --chown=wso2carbon:wso2 init.sh ${WORKING_DIRECTORY}/ -COPY --chown=wso2carbon:wso2 ${FILES}/mysql-connector-java-*-bin.jar ${WSO2_SERVER_HOME}/wso2/analytics/lib/ # expose analytics ports -EXPOSE 9444 7612 7712 9161 +EXPOSE 9713 9643 9613 7713 7613 # set entrypoint to init script ENTRYPOINT ["/home/wso2carbon/init.sh"] diff --git a/dockerfiles/centos/analytics/dashboard/init.sh b/dockerfiles/centos/analytics/dashboard/init.sh index 09fb2a75..cf15386c 100755 --- a/dockerfiles/centos/analytics/dashboard/init.sh +++ b/dockerfiles/centos/analytics/dashboard/init.sh @@ -65,4 +65,4 @@ test -d ${config_volume}/ && cp -RL ${config_volume}/* ${WSO2_SERVER_HOME}/ test -d ${artifact_volume}/ && cp -RL ${artifact_volume}/* ${WSO2_SERVER_HOME}/ # start WSO2 Carbon server -sh ${WSO2_SERVER_HOME}/bin/analytics-dashboard.sh +sh ${WSO2_SERVER_HOME}/bin/analytics-dashboard.sh "$@" diff --git a/dockerfiles/centos/analytics/worker/Dockerfile b/dockerfiles/centos/analytics/worker/Dockerfile index 610c2ae3..4c74ea81 100644 --- a/dockerfiles/centos/analytics/worker/Dockerfile +++ b/dockerfiles/centos/analytics/worker/Dockerfile @@ -17,15 +17,13 @@ # ------------------------------------------------------------------------ # set to product base image -FROM wso2ei-base:6.4.0-centos -ARG FILES=./files +FROM wso2ei-analytics-base:6.4.0-centos # copy entrypoint bash script to user home COPY --chown=wso2carbon:wso2 init.sh ${WORKING_DIRECTORY}/ -COPY --chown=wso2carbon:wso2 ${FILES}/mysql-connector-java-*-bin.jar ${WSO2_SERVER_HOME}/wso2/analytics/lib/ # expose analytics ports -EXPOSE 9444 7612 7712 9161 +EXPOSE 9091 9444 9712 9612 7712 7612 7070 7443 # set entrypoint to init script ENTRYPOINT ["/home/wso2carbon/init.sh"] diff --git a/dockerfiles/centos/analytics/worker/init.sh b/dockerfiles/centos/analytics/worker/init.sh index e9d10b64..40415a43 100755 --- a/dockerfiles/centos/analytics/worker/init.sh +++ b/dockerfiles/centos/analytics/worker/init.sh @@ -65,4 +65,4 @@ test -d ${config_volume}/ && cp -RL ${config_volume}/* ${WSO2_SERVER_HOME}/ test -d ${artifact_volume}/ && cp -RL ${artifact_volume}/* ${WSO2_SERVER_HOME}/ # start WSO2 Carbon server -sh ${WSO2_SERVER_HOME}/bin/analytics-worker.sh +sh ${WSO2_SERVER_HOME}/bin/analytics-worker.sh "$@" diff --git a/dockerfiles/centos/broker/Dockerfile b/dockerfiles/centos/broker/Dockerfile index 4ed6e82d..9d50e4b5 100644 --- a/dockerfiles/centos/broker/Dockerfile +++ b/dockerfiles/centos/broker/Dockerfile @@ -16,15 +16,64 @@ # # ------------------------------------------------------------------------ -# set to product base image -FROM wso2ei-base:6.4.0-centos +# set to latest Centos +FROM centos:7 +MAINTAINER WSO2 Docker Maintainers "dev@wso2.org" -# copy entrypoint bash script to user home -COPY --chown=wso2carbon:wso2 init.sh ${WORKING_DIRECTORY}/ +# set user configurations +ARG USER=wso2carbon +ARG USER_ID=802 +ARG USER_GROUP=wso2 +ARG USER_GROUP_ID=802 +ARG USER_HOME=/home/${USER} +# set dependant files directory +ARG FILES=./files +# set jdk configurations +ARG JDK=jdk8u* +ARG JAVA_HOME=${USER_HOME}/java +# set wso2 product configurations +ARG WSO2_SERVER=wso2ei +ARG WSO2_SERVER_VERSION=6.4.0 +ARG WSO2_SERVER_PACK=${WSO2_SERVER}-${WSO2_SERVER_VERSION} +ARG WSO2_SERVER_HOME=${USER_HOME}/${WSO2_SERVER_PACK} +# set WSO2 EULA +ARG MOTD='printf "\n\ + Welcome to WSO2 Docker Resources \n\ + --------------------------------- \n\ + This Docker container comprises of a WSO2 product, running with its latest updates \n\ + which are under the End User License Agreement (EULA) 2.0. \n\ + Read more about EULA 2.0 here @ https://wso2.com/licenses/wso2-update/2.0 \n"' -# set temporary location for shared artifacts -RUN mkdir -p ${WORKING_DIRECTORY}/wso2-tmp/ && \ - cp -r ${WSO2_SERVER_HOME}/wso2/broker/repository/deployment/ ${WORKING_DIRECTORY}/wso2-tmp/deployment/ +# install required packages +RUN yum -y update && \ + yum install -y nc && \ + rm -rf /var/cache/yum/* && \ + echo $MOTD > /etc/profile.d/motd.sh + +# create a user group and a user +RUN groupadd --system -g ${USER_GROUP_ID} ${USER_GROUP} && \ + useradd --system --create-home --home-dir ${USER_HOME} --no-log-init -g ${USER_GROUP_ID} -u ${USER_ID} ${USER} + +# copy the jdk and wso2 product distributions to user's home directory +COPY --chown=wso2carbon:wso2 ${FILES}/${JDK} ${USER_HOME}/java/ +COPY --chown=wso2carbon:wso2 ${FILES}/${WSO2_SERVER_PACK}/ ${WSO2_SERVER_HOME}/ +# copy init script to user home +COPY --chown=wso2carbon:wso2 init.sh ${USER_HOME}/ +# copy mysql connector jar to the server as a third party library +COPY --chown=wso2carbon:wso2 ${FILES}/mysql-connector-java-*-bin.jar ${WSO2_SERVER_HOME}/lib/ +# add libraries for Kubernetes membership scheme based clustering +ADD --chown=wso2carbon:wso2 https://repo1.maven.org/maven2/dnsjava/dnsjava/2.1.8/dnsjava-2.1.8.jar ${WSO2_SERVER_HOME}/lib/ +ADD --chown=wso2carbon:wso2 https://repo1.maven.org/maven2/org/wso2/carbon/kubernetes/artifacts/kubernetes-membership-scheme/1.0.5/kubernetes-membership-scheme-1.0.5.jar ${WSO2_SERVER_HOME}/dropins/ + +# set the user and work directory +USER ${USER_ID} +WORKDIR ${USER_HOME} + +# set environment variables +ENV JAVA_HOME=${JAVA_HOME} \ + PATH=$JAVA_HOME/bin:$PATH \ + WSO2_SERVER_HOME=${WSO2_SERVER_HOME} \ + WORKING_DIRECTORY=${USER_HOME} # expose broker ports EXPOSE 9446 9766 5675 8675 1886 8836 7614 4000 diff --git a/dockerfiles/centos/broker/files/.gitkeep b/dockerfiles/centos/broker/files/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/dockerfiles/centos/broker/init.sh b/dockerfiles/centos/broker/init.sh index a66992c3..47420685 100755 --- a/dockerfiles/centos/broker/init.sh +++ b/dockerfiles/centos/broker/init.sh @@ -22,10 +22,6 @@ server_profile=broker # volume mounts config_volume=${WORKING_DIRECTORY}/wso2-config-volume artifact_volume=${WORKING_DIRECTORY}/wso2-artifact-volume -deployment_volume=${WSO2_SERVER_HOME}/wso2/${server_profile}/repository/deployment - -# original deployment artifacts -original_deployment_artifacts=${WORKING_DIRECTORY}/wso2-tmp/deployment # a grace period for mounts to be setup echo "Waiting for all volumes to be mounted..." @@ -69,17 +65,6 @@ test ! -d ${WORKING_DIRECTORY} && echo "WSO2 Docker non-root user home does not # check if the WSO2 product home exists test ! -d ${WSO2_SERVER_HOME} && echo "WSO2 Docker product home does not exist" && exit 1 -# if a deployment_volume is present and empty, copy original deployment artifacts to server... -# copying original artifacts to ${WORKING_DIRECTORY}/wso2-tmp/deployment was already done in the Dockerfile -# these artifacts will be copied to deployment_volume if it is empty, before the server is started -if test -d ${original_deployment_artifacts}; then - if [ -z "$(ls -A ${deployment_volume}/)" ]; then - # if no artifact is found under /wso2/broker/repository/deployment; copy originals - echo "Copying original deployment artifacts from temporary location to server..." - cp -R ${original_deployment_artifacts}/* ${deployment_volume}/ - fi -fi - # copy any configuration changes mounted to config_volume test -d ${config_volume}/ && cp -RL ${config_volume}/* ${WSO2_SERVER_HOME}/ # copy any artifact changes mounted to artifact_volume @@ -92,4 +77,4 @@ sed -i "s##.*#${docker_container_ip}#" ${WSO2_SERVER_HOME}/wso2/${server_profile}/conf/broker.xml # start WSO2 Carbon server -sh ${WSO2_SERVER_HOME}/bin/${server_profile}.sh +sh ${WSO2_SERVER_HOME}/bin/${server_profile}.sh "$@" diff --git a/dockerfiles/centos/business-process/Dockerfile b/dockerfiles/centos/business-process/Dockerfile index af0f99e5..0ef20625 100644 --- a/dockerfiles/centos/business-process/Dockerfile +++ b/dockerfiles/centos/business-process/Dockerfile @@ -16,15 +16,64 @@ # # ------------------------------------------------------------------------ -# set to product base image -FROM wso2ei-base:6.4.0-centos +# set to latest Centos +FROM centos:7 +MAINTAINER WSO2 Docker Maintainers "dev@wso2.org" -# copy entrypoint bash script to user home -COPY --chown=wso2carbon:wso2 init.sh ${WORKING_DIRECTORY}/ +# set user configurations +ARG USER=wso2carbon +ARG USER_ID=802 +ARG USER_GROUP=wso2 +ARG USER_GROUP_ID=802 +ARG USER_HOME=/home/${USER} +# set dependant files directory +ARG FILES=./files +# set jdk configurations +ARG JDK=jdk8u* +ARG JAVA_HOME=${USER_HOME}/java +# set wso2 product configurations +ARG WSO2_SERVER=wso2ei +ARG WSO2_SERVER_VERSION=6.4.0 +ARG WSO2_SERVER_PACK=${WSO2_SERVER}-${WSO2_SERVER_VERSION} +ARG WSO2_SERVER_HOME=${USER_HOME}/${WSO2_SERVER_PACK} +# set WSO2 EULA +ARG MOTD='printf "\n\ + Welcome to WSO2 Docker Resources \n\ + --------------------------------- \n\ + This Docker container comprises of a WSO2 product, running with its latest updates \n\ + which are under the End User License Agreement (EULA) 2.0. \n\ + Read more about EULA 2.0 here @ https://wso2.com/licenses/wso2-update/2.0 \n"' -# set temporary location for shared artifacts -RUN mkdir -p ${WORKING_DIRECTORY}/wso2-tmp/ && \ - cp -r ${WSO2_SERVER_HOME}/wso2/business-process/repository/deployment/server/ ${WORKING_DIRECTORY}/wso2-tmp/server/ +# install required packages +RUN yum -y update && \ + yum install -y nc && \ + rm -rf /var/cache/yum/* && \ + echo $MOTD > /etc/profile.d/motd.sh + +# create a user group and a user +RUN groupadd --system -g ${USER_GROUP_ID} ${USER_GROUP} && \ + useradd --system --create-home --home-dir ${USER_HOME} --no-log-init -g ${USER_GROUP_ID} -u ${USER_ID} ${USER} + +# copy the jdk and wso2 product distributions to user's home directory +COPY --chown=wso2carbon:wso2 ${FILES}/${JDK} ${USER_HOME}/java/ +COPY --chown=wso2carbon:wso2 ${FILES}/${WSO2_SERVER_PACK}/ ${WSO2_SERVER_HOME}/ +# copy init script to user home +COPY --chown=wso2carbon:wso2 init.sh ${USER_HOME}/ +# copy mysql connector jar to the server as a third party library +COPY --chown=wso2carbon:wso2 ${FILES}/mysql-connector-java-*-bin.jar ${WSO2_SERVER_HOME}/lib/ +# add libraries for Kubernetes membership scheme based clustering +ADD --chown=wso2carbon:wso2 https://repo1.maven.org/maven2/dnsjava/dnsjava/2.1.8/dnsjava-2.1.8.jar ${WSO2_SERVER_HOME}/lib/ +ADD --chown=wso2carbon:wso2 https://repo1.maven.org/maven2/org/wso2/carbon/kubernetes/artifacts/kubernetes-membership-scheme/1.0.5/kubernetes-membership-scheme-1.0.5.jar ${WSO2_SERVER_HOME}/dropins/ + +# set the user and work directory +USER ${USER_ID} +WORKDIR ${USER_HOME} + +# set environment variables +ENV JAVA_HOME=${JAVA_HOME} \ + PATH=$JAVA_HOME/bin:$PATH \ + WSO2_SERVER_HOME=${WSO2_SERVER_HOME} \ + WORKING_DIRECTORY=${USER_HOME} # expose business-process ports EXPOSE 9445 9765 4000 diff --git a/dockerfiles/centos/business-process/files/.gitkeep b/dockerfiles/centos/business-process/files/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/dockerfiles/centos/business-process/init.sh b/dockerfiles/centos/business-process/init.sh index 0ec36450..336e5b57 100755 --- a/dockerfiles/centos/business-process/init.sh +++ b/dockerfiles/centos/business-process/init.sh @@ -22,10 +22,6 @@ server_profile=business-process # volume mounts config_volume=${WORKING_DIRECTORY}/wso2-config-volume artifact_volume=${WORKING_DIRECTORY}/wso2-artifact-volume -deployment_volume=${WSO2_SERVER_HOME}/wso2/${server_profile}/repository/deployment/server - -# original deployment artifacts -original_deployment_artifacts=${WORKING_DIRECTORY}/wso2-tmp/server # a grace period for mounts to be setup echo "Waiting for all volumes to be mounted..." @@ -69,17 +65,6 @@ test ! -d ${WORKING_DIRECTORY} && echo "WSO2 Docker non-root user home does not # check if the WSO2 product home exists test ! -d ${WSO2_SERVER_HOME} && echo "WSO2 Docker product home does not exist" && exit 1 -# if a deployment_volume is present and empty, copy original deployment artifacts to server... -# copying original artifacts to ${WORKING_DIRECTORY}/wso2-tmp/server was already done in the Dockerfile -# these artifacts will be copied to deployment_volume if it is empty, before the server is started -if test -d ${original_deployment_artifacts}; then - if [ -z "$(ls -A ${deployment_volume}/)" ]; then - # if no artifact is found under /wso2/business-process/repository/deployment/server; copy originals - echo "Copying original deployment artifacts from temporary location to server..." - cp -R ${original_deployment_artifacts}/* ${deployment_volume}/ - fi -fi - # copy any configuration changes mounted to config_volume test -d ${config_volume}/ && cp -RL ${config_volume}/* ${WSO2_SERVER_HOME}/ # copy any artifact changes mounted to artifact_volume @@ -92,4 +77,4 @@ sed -i "s##.*<\/tns:NodeId>#${docker_container_ip}<\/tns:NodeId>#" ${WSO2_SERVER_HOME}/wso2/${server_profile}/conf/bps.xml # start WSO2 Carbon server -sh ${WSO2_SERVER_HOME}/bin/${server_profile}.sh +sh ${WSO2_SERVER_HOME}/bin/${server_profile}.sh "$@" diff --git a/dockerfiles/centos/integrator/Dockerfile b/dockerfiles/centos/integrator/Dockerfile index 8e0c7703..d09b6c39 100644 --- a/dockerfiles/centos/integrator/Dockerfile +++ b/dockerfiles/centos/integrator/Dockerfile @@ -16,19 +16,67 @@ # # ------------------------------------------------------------------------ -# set to product base image -FROM wso2ei-base:6.4.0-centos +# set to latest Centos +FROM centos:7 +MAINTAINER WSO2 Docker Maintainers "dev@wso2.org" +# set user configurations +ARG USER=wso2carbon +ARG USER_ID=802 +ARG USER_GROUP=wso2 +ARG USER_GROUP_ID=802 +ARG USER_HOME=/home/${USER} # set dependant files directory ARG FILES=./files +# set jdk configurations +ARG JDK=jdk8u* +ARG JAVA_HOME=${USER_HOME}/java +# set wso2 product configurations +ARG WSO2_SERVER=wso2ei +ARG WSO2_SERVER_VERSION=6.4.0 +ARG WSO2_SERVER_PACK=${WSO2_SERVER}-${WSO2_SERVER_VERSION} +ARG WSO2_SERVER_HOME=${USER_HOME}/${WSO2_SERVER_PACK} +# set WSO2 EULA +ARG MOTD='printf "\n\ + Welcome to WSO2 Docker Resources \n\ + --------------------------------- \n\ + This Docker container comprises of a WSO2 product, running with its latest updates \n\ + which are under the End User License Agreement (EULA) 2.0. \n\ + Read more about EULA 2.0 here @ https://wso2.com/licenses/wso2-update/2.0 \n"' -# copy entrypoint bash script to user home and external libraries to product home -COPY --chown=wso2carbon:wso2 init.sh ${WORKING_DIRECTORY}/ -COPY --chown=wso2carbon:wso2 ${FILES} ${WSO2_SERVER_HOME}/lib +# install required packages +RUN yum -y update && \ + yum install -y nc && \ + rm -rf /var/cache/yum/* && \ + echo $MOTD > /etc/profile.d/motd.sh -# set temporary location for shared artifacts -RUN mkdir -p ${WORKING_DIRECTORY}/wso2-tmp/ && \ - cp -r ${WSO2_SERVER_HOME}/repository/deployment/server/ ${WORKING_DIRECTORY}/wso2-tmp/server/ +# create a user group and a user +RUN groupadd --system -g ${USER_GROUP_ID} ${USER_GROUP} && \ + useradd --system --create-home --home-dir ${USER_HOME} --no-log-init -g ${USER_GROUP_ID} -u ${USER_ID} ${USER} + +# copy the jdk and wso2 product distributions to user's home directory +COPY --chown=wso2carbon:wso2 ${FILES}/${JDK} ${USER_HOME}/java/ +COPY --chown=wso2carbon:wso2 ${FILES}/${WSO2_SERVER_PACK}/ ${WSO2_SERVER_HOME}/ +# copy shared artifacts to a temporary location +COPY --chown=wso2carbon:wso2 ${FILES}/${WSO2_SERVER_PACK}/repository/deployment/server/ ${USER_HOME}/wso2-tmp/server/ +# copy init script to user home +COPY --chown=wso2carbon:wso2 init.sh ${USER_HOME}/ +# copy relevant libraries (mysql connector jar and integrator libraries) to product distribution +COPY --chown=wso2carbon:wso2 ${FILES}/mysql-connector-java-*-bin.jar ${WSO2_SERVER_HOME}/lib/ +COPY --chown=wso2carbon:wso2 ${FILES}/lib ${WSO2_SERVER_HOME}/lib/ +# add libraries for Kubernetes membership scheme based clustering +ADD --chown=wso2carbon:wso2 https://repo1.maven.org/maven2/dnsjava/dnsjava/2.1.8/dnsjava-2.1.8.jar ${WSO2_SERVER_HOME}/lib/ +ADD --chown=wso2carbon:wso2 https://repo1.maven.org/maven2/org/wso2/carbon/kubernetes/artifacts/kubernetes-membership-scheme/1.0.5/kubernetes-membership-scheme-1.0.5.jar ${WSO2_SERVER_HOME}/dropins/ + +# set the user and work directory +USER ${USER_ID} +WORKDIR ${USER_HOME} + +# set environment variables +ENV JAVA_HOME=${JAVA_HOME} \ + PATH=$JAVA_HOME/bin:$PATH \ + WSO2_SERVER_HOME=${WSO2_SERVER_HOME} \ + WORKING_DIRECTORY=${USER_HOME} # expose integrator ports EXPOSE 8280 8243 9443 4100 diff --git a/dockerfiles/centos/integrator/init.sh b/dockerfiles/centos/integrator/init.sh index 93e4bc50..b5d902ac 100755 --- a/dockerfiles/centos/integrator/init.sh +++ b/dockerfiles/centos/integrator/init.sh @@ -87,4 +87,4 @@ test -d ${artifact_volume}/ && cp -RL ${artifact_volume}/* ${WSO2_SERVER_HOME}/ sed -i "s##${docker_container_ip}<\/parameter>#" ${WSO2_SERVER_HOME}/conf/axis2/axis2.xml # start WSO2 Carbon server -sh ${WSO2_SERVER_HOME}/bin/integrator.sh +sh ${WSO2_SERVER_HOME}/bin/integrator.sh "$@" diff --git a/dockerfiles/centos/micro-integrator/Dockerfile b/dockerfiles/centos/micro-integrator/Dockerfile index 21707e45..bf386b0c 100644 --- a/dockerfiles/centos/micro-integrator/Dockerfile +++ b/dockerfiles/centos/micro-integrator/Dockerfile @@ -16,11 +16,61 @@ # # ------------------------------------------------------------------------ -# set to product base image -FROM wso2ei-base:6.4.0-centos +# set to latest Centos +FROM centos:7 +MAINTAINER WSO2 Docker Maintainers "dev@wso2.org" -# copy entrypoint bash script to user home -COPY --chown=wso2carbon:wso2 init.sh ${WORKING_DIRECTORY}/ +# set user configurations +ARG USER=wso2carbon +ARG USER_ID=802 +ARG USER_GROUP=wso2 +ARG USER_GROUP_ID=802 +ARG USER_HOME=/home/${USER} +# set dependant files directory +ARG FILES=./files +# set jdk configurations +ARG JDK=jdk8u* +ARG JAVA_HOME=${USER_HOME}/java +# set wso2 product configurations +ARG WSO2_SERVER=wso2ei +ARG WSO2_SERVER_VERSION=6.4.0 +ARG WSO2_SERVER_PACK=${WSO2_SERVER}-${WSO2_SERVER_VERSION} +ARG WSO2_SERVER_HOME=${USER_HOME}/${WSO2_SERVER_PACK} +# set WSO2 EULA +ARG MOTD='printf "\n\ + Welcome to WSO2 Docker Resources \n\ + --------------------------------- \n\ + This Docker container comprises of a WSO2 product, running with its latest updates \n\ + which are under the End User License Agreement (EULA) 2.0. \n\ + Read more about EULA 2.0 here @ https://wso2.com/licenses/wso2-update/2.0 \n"' + +# install required packages +RUN yum -y update && \ + yum install -y nc && \ + rm -rf /var/cache/yum/* && \ + echo $MOTD > /etc/profile.d/motd.sh + +# create a user group and a user +RUN groupadd --system -g ${USER_GROUP_ID} ${USER_GROUP} && \ + useradd --system --create-home --home-dir ${USER_HOME} --no-log-init -g ${USER_GROUP_ID} -u ${USER_ID} ${USER} + +# copy the jdk and wso2 product distributions to user's home directory +COPY --chown=wso2carbon:wso2 ${FILES}/${JDK} ${USER_HOME}/java/ +COPY --chown=wso2carbon:wso2 ${FILES}/${WSO2_SERVER_PACK}/ ${WSO2_SERVER_HOME}/ +# copy init script to user home +COPY --chown=wso2carbon:wso2 init.sh ${USER_HOME}/ +# copy mysql connector jar to the server as a third party library +COPY --chown=wso2carbon:wso2 ${FILES}/mysql-connector-java-*-bin.jar ${WSO2_SERVER_HOME}/lib/ + +# set the user and work directory +USER ${USER_ID} +WORKDIR ${USER_HOME} + +# set environment variables +ENV JAVA_HOME=${JAVA_HOME} \ + PATH=$JAVA_HOME/bin:$PATH \ + WSO2_SERVER_HOME=${WSO2_SERVER_HOME} \ + WORKING_DIRECTORY=${USER_HOME} # expose micro-integrator ports EXPOSE 8290 8253 diff --git a/dockerfiles/centos/micro-integrator/files/.gitkeep b/dockerfiles/centos/micro-integrator/files/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/dockerfiles/centos/micro-integrator/init.sh b/dockerfiles/centos/micro-integrator/init.sh index 9389e94b..a7b6b35e 100755 --- a/dockerfiles/centos/micro-integrator/init.sh +++ b/dockerfiles/centos/micro-integrator/init.sh @@ -68,4 +68,4 @@ test -d ${config_volume}/ && cp -RL ${config_volume}/* ${WSO2_SERVER_HOME}/ test -d ${artifact_volume}/ && cp -RL ${artifact_volume}/* ${WSO2_SERVER_HOME}/ # start WSO2 Carbon server -sh ${WSO2_SERVER_HOME}/bin/micro-integrator.sh +sh ${WSO2_SERVER_HOME}/bin/micro-integrator.sh "$@" diff --git a/dockerfiles/centos/msf4j/Dockerfile b/dockerfiles/centos/msf4j/Dockerfile index 1962585d..e7ebf395 100644 --- a/dockerfiles/centos/msf4j/Dockerfile +++ b/dockerfiles/centos/msf4j/Dockerfile @@ -16,11 +16,59 @@ # # ------------------------------------------------------------------------ -# set to product base image -FROM wso2ei-base:6.4.0-centos +# set to latest Centos +FROM centos:7 +MAINTAINER WSO2 Docker Maintainers "dev@wso2.org" -# copy entrypoint bash script to user home -COPY --chown=wso2carbon:wso2 init.sh ${WORKING_DIRECTORY}/ +# set user configurations +ARG USER=wso2carbon +ARG USER_ID=802 +ARG USER_GROUP=wso2 +ARG USER_GROUP_ID=802 +ARG USER_HOME=/home/${USER} +# set dependant files directory +ARG FILES=./files +# set jdk configurations +ARG JDK=jdk8u* +ARG JAVA_HOME=${USER_HOME}/java +# set wso2 product configurations +ARG WSO2_SERVER=wso2ei +ARG WSO2_SERVER_VERSION=6.4.0 +ARG WSO2_SERVER_PACK=${WSO2_SERVER}-${WSO2_SERVER_VERSION} +ARG WSO2_SERVER_HOME=${USER_HOME}/${WSO2_SERVER_PACK} +# set WSO2 EULA +ARG MOTD='printf "\n\ + Welcome to WSO2 Docker Resources \n\ + --------------------------------- \n\ + This Docker container comprises of a WSO2 product, running with its latest updates \n\ + which are under the End User License Agreement (EULA) 2.0. \n\ + Read more about EULA 2.0 here @ https://wso2.com/licenses/wso2-update/2.0 \n"' + +# install required packages +RUN yum -y update && \ + yum install -y nc && \ + rm -rf /var/cache/yum/* && \ + echo $MOTD > /etc/profile.d/motd.sh + +# create a user group and a user +RUN groupadd --system -g ${USER_GROUP_ID} ${USER_GROUP} && \ + useradd --system --create-home --home-dir ${USER_HOME} --no-log-init -g ${USER_GROUP_ID} -u ${USER_ID} ${USER} + +# copy the jdk and wso2 product distributions to user's home directory +COPY --chown=wso2carbon:wso2 ${FILES}/${JDK} ${USER_HOME}/java/ +COPY --chown=wso2carbon:wso2 ${FILES}/${WSO2_SERVER_PACK}/ ${WSO2_SERVER_HOME}/ +# copy init script to user home +COPY --chown=wso2carbon:wso2 init.sh ${USER_HOME}/ + +# set the user and work directory +USER ${USER_ID} +WORKDIR ${USER_HOME} + +# set environment variables +ENV JAVA_HOME=${JAVA_HOME} \ + PATH=$JAVA_HOME/bin:$PATH \ + WSO2_SERVER_HOME=${WSO2_SERVER_HOME} \ + WORKING_DIRECTORY=${USER_HOME} # expose msf4j ports EXPOSE 9090 diff --git a/dockerfiles/centos/msf4j/files/.gitkeep b/dockerfiles/centos/msf4j/files/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/dockerfiles/centos/msf4j/init.sh b/dockerfiles/centos/msf4j/init.sh index ffe9320f..33894f8e 100755 --- a/dockerfiles/centos/msf4j/init.sh +++ b/dockerfiles/centos/msf4j/init.sh @@ -35,4 +35,4 @@ test -d ${config_volume}/ && cp -RL ${config_volume}/* ${WSO2_SERVER_HOME}/ test -d ${artifact_volume}/ && cp -RL ${artifact_volume}/* ${WSO2_SERVER_HOME}/ # start WSO2 Carbon server -sh ${WSO2_SERVER_HOME}/bin/msf4j.sh +sh ${WSO2_SERVER_HOME}/bin/msf4j.sh "$@" diff --git a/dockerfiles/ubuntu/analytics/dashboard/Dockerfile b/dockerfiles/ubuntu/analytics/dashboard/Dockerfile index acb3a47d..9bce10ac 100644 --- a/dockerfiles/ubuntu/analytics/dashboard/Dockerfile +++ b/dockerfiles/ubuntu/analytics/dashboard/Dockerfile @@ -19,9 +19,6 @@ # set to product base image FROM wso2ei-analytics-base:6.4.0 -# set dependant files directory -ARG FILES=./files - # copy entrypoint bash script to user home COPY --chown=wso2carbon:wso2 init.sh ${WORKING_DIRECTORY}/ diff --git a/dockerfiles/ubuntu/analytics/worker/Dockerfile b/dockerfiles/ubuntu/analytics/worker/Dockerfile index 50a478cb..90fe1e49 100644 --- a/dockerfiles/ubuntu/analytics/worker/Dockerfile +++ b/dockerfiles/ubuntu/analytics/worker/Dockerfile @@ -19,9 +19,6 @@ # set to product base image FROM wso2ei-analytics-base:6.4.0 -# set dependant files directory -ARG FILES=./files - # copy entrypoint bash script to user home COPY --chown=wso2carbon:wso2 init.sh ${WORKING_DIRECTORY}/ diff --git a/dockerfiles/ubuntu/business-process/init.sh b/dockerfiles/ubuntu/business-process/init.sh index c90d0aba..af553313 100755 --- a/dockerfiles/ubuntu/business-process/init.sh +++ b/dockerfiles/ubuntu/business-process/init.sh @@ -22,10 +22,6 @@ server_profile=business-process # volume mounts config_volume=${WORKING_DIRECTORY}/wso2-config-volume artifact_volume=${WORKING_DIRECTORY}/wso2-artifact-volume -deployment_volume=${WSO2_SERVER_HOME}/wso2/${server_profile}/repository/deployment/server - -# original deployment artifacts -original_deployment_artifacts=${WORKING_DIRECTORY}/wso2-tmp/server # capture Docker container IP from the container's /etc/hosts file docker_container_ip=$(awk 'END{print $1}' /etc/hosts) @@ -36,17 +32,6 @@ test ! -d ${WORKING_DIRECTORY} && echo "WSO2 Docker non-root user home does not # check if the WSO2 product home exists test ! -d ${WSO2_SERVER_HOME} && echo "WSO2 Docker product home does not exist" && exit 1 -# if a deployment_volume is present and empty, copy original deployment artifacts to server... -# copying original artifacts to ${WORKING_DIRECTORY}/wso2-tmp/server was already done in the Dockerfile -# these artifacts will be copied to deployment_volume if it is empty, before the server is started -if test -d ${original_deployment_artifacts}; then - if [ -z "$(ls -A ${deployment_volume}/)" ]; then - # if no artifact is found under /wso2/business-process/repository/deployment/server; copy originals - echo "Copying original deployment artifacts from temporary location to server..." - cp -R ${original_deployment_artifacts}/* ${deployment_volume}/ - fi -fi - # copy any configuration changes mounted to config_volume test -d ${config_volume}/ && cp -RL ${config_volume}/* ${WSO2_SERVER_HOME}/ # copy any artifact changes mounted to artifact_volume diff --git a/dockerfiles/ubuntu/integrator/Dockerfile b/dockerfiles/ubuntu/integrator/Dockerfile index ffbc9cd9..6b90c5f1 100644 --- a/dockerfiles/ubuntu/integrator/Dockerfile +++ b/dockerfiles/ubuntu/integrator/Dockerfile @@ -62,18 +62,19 @@ RUN mkdir -p ${USER_HOME}/.java/.systemPrefs && \ chmod -R 755 ${USER_HOME}/.java && \ chown -R ${USER}:${USER_GROUP} ${USER_HOME}/.java -# copy wso2 product distribution to user's home directory and copy relevant libraries (mysql connector jar and integrator libraries) to product distribution +# copy wso2 product distribution to user's home directory COPY --chown=wso2carbon:wso2 ${FILES}/${WSO2_SERVER_PACK} ${WSO2_SERVER_HOME} -COPY --chown=wso2carbon:wso2 ${FILES}/lib ${WSO2_SERVER_HOME}/lib +# copy shared artifacts to a temporary location +COPY --chown=wso2carbon:wso2 ${FILES}/${WSO2_SERVER_PACK}/repository/deployment/server/ ${USER_HOME}/wso2-tmp/server/ # copy entrypoint bash script to user home COPY --chown=wso2carbon:wso2 init.sh ${USER_HOME}/ +# copy relevant libraries (mysql connector jar and integrator libraries) to product distribution +COPY --chown=wso2carbon:wso2 ${FILES}/mysql-connector-java-*-bin.jar ${WSO2_SERVER_HOME}/lib/ +COPY --chown=wso2carbon:wso2 ${FILES}/lib ${WSO2_SERVER_HOME}/lib/ # add libraries for Kubernetes membership scheme based clustering ADD --chown=wso2carbon:wso2 https://repo1.maven.org/maven2/dnsjava/dnsjava/2.1.8/dnsjava-2.1.8.jar ${WSO2_SERVER_HOME}/lib ADD --chown=wso2carbon:wso2 https://repo1.maven.org/maven2/org/wso2/carbon/kubernetes/artifacts/kubernetes-membership-scheme/1.0.5/kubernetes-membership-scheme-1.0.5.jar ${WSO2_SERVER_HOME}/dropins -# set temporary location for shared artifacts -RUN mkdir -p ${WORKING_DIRECTORY}/wso2-tmp/ && cp -r ${WSO2_SERVER_HOME}/repository/deployment/server/ ${WORKING_DIRECTORY}/wso2-tmp/server/ - # set the user and work directory USER ${USER_ID} WORKDIR ${USER_HOME} diff --git a/dockerfiles/ubuntu/micro-integrator/Dockerfile b/dockerfiles/ubuntu/micro-integrator/Dockerfile index 29479eed..a661d6d3 100644 --- a/dockerfiles/ubuntu/micro-integrator/Dockerfile +++ b/dockerfiles/ubuntu/micro-integrator/Dockerfile @@ -55,21 +55,11 @@ RUN apt-get update && \ RUN groupadd --system -g ${USER_GROUP_ID} ${USER_GROUP} && \ useradd --system --create-home --home-dir ${USER_HOME} --no-log-init -g ${USER_GROUP_ID} -u ${USER_ID} ${USER} -# create java prefs dir -# this is to avoid warning logs printed by FileSystemPreferences class -RUN mkdir -p ${USER_HOME}/.java/.systemPrefs && \ - mkdir -p ${USER_HOME}/.java/.userPrefs && \ - chmod -R 755 ${USER_HOME}/.java && \ - chown -R ${USER}:${USER_GROUP} ${USER_HOME}/.java - # copy wso2 product distribution to user's home directory and copy mysql connector jar to product distribution COPY --chown=wso2carbon:wso2 ${FILES}/${WSO2_SERVER_PACK} ${WSO2_SERVER_HOME} COPY --chown=wso2carbon:wso2 ${FILES}/mysql-connector-java-*-bin.jar ${WSO2_SERVER_HOME}/lib # copy entrypoint bash script to user home COPY --chown=wso2carbon:wso2 init.sh ${USER_HOME}/ -# add libraries for Kubernetes membership scheme based clustering -ADD --chown=wso2carbon:wso2 https://repo1.maven.org/maven2/dnsjava/dnsjava/2.1.8/dnsjava-2.1.8.jar ${WSO2_SERVER_HOME}/lib -ADD --chown=wso2carbon:wso2 https://repo1.maven.org/maven2/org/wso2/carbon/kubernetes/artifacts/kubernetes-membership-scheme/1.0.5/kubernetes-membership-scheme-1.0.5.jar ${WSO2_SERVER_HOME}/dropins # set the user and work directory USER ${USER_ID} @@ -77,8 +67,7 @@ WORKDIR ${USER_HOME} # set environment variables ENV WSO2_SERVER_HOME=${WSO2_SERVER_HOME} \ - WORKING_DIRECTORY=${USER_HOME} \ - JAVA_OPTS="-Djava.util.prefs.systemRoot=${USER_HOME}/.java -Djava.util.prefs.userRoot=${USER_HOME}/.java/.userPrefs" + WORKING_DIRECTORY=${USER_HOME} # expose micro-integrator ports EXPOSE 8290 8253 diff --git a/dockerfiles/ubuntu/msf4j/Dockerfile b/dockerfiles/ubuntu/msf4j/Dockerfile index 2fb86f31..e47993b1 100644 --- a/dockerfiles/ubuntu/msf4j/Dockerfile +++ b/dockerfiles/ubuntu/msf4j/Dockerfile @@ -55,11 +55,12 @@ RUN apt-get update && \ RUN groupadd --system -g ${USER_GROUP_ID} ${USER_GROUP} && \ useradd --system --create-home --home-dir ${USER_HOME} --no-log-init -g ${USER_GROUP_ID} -u ${USER_ID} ${USER} -# copy wso2 product distribution to user's home directory and copy mysql connector jar to product distribution +# copy wso2 product distribution to user's home directory COPY --chown=wso2carbon:wso2 ${FILES}/${WSO2_SERVER_PACK} ${WSO2_SERVER_HOME} -COPY --chown=wso2carbon:wso2 ${FILES}/mysql-connector-java-*-bin.jar ${WSO2_SERVER_HOME}/lib # copy entrypoint bash script to user home COPY --chown=wso2carbon:wso2 init.sh ${USER_HOME}/ +# copy mysql connector jar to the server as a third party library +COPY --chown=wso2carbon:wso2 ${FILES}/mysql-connector-java-*-bin.jar ${WSO2_SERVER_HOME}/lib/ # set the user and work directory USER ${USER_ID} From 1f0c65aa418c1f634525079b1c32ffbd6b84d4e7 Mon Sep 17 00:00:00 2001 From: chirangaalwis Date: Fri, 11 Jan 2019 14:37:20 +0530 Subject: [PATCH 4/4] Update README.md documentation --- dockerfiles/alpine/README.md | 138 ----------------- dockerfiles/alpine/analytics/README.md | 110 ++++++++++++++ dockerfiles/alpine/broker/README.md | 88 +++++++++++ dockerfiles/alpine/business-process/README.md | 86 +++++++++++ dockerfiles/alpine/integrator/README.md | 86 +++++++++++ dockerfiles/alpine/micro-integrator/README.md | 82 ++++++++++ dockerfiles/alpine/msf4j/README.md | 82 ++++++++++ dockerfiles/centos/README.md | 140 ------------------ dockerfiles/centos/analytics/README.md | 111 ++++++++++++++ dockerfiles/centos/broker/README.md | 89 +++++++++++ dockerfiles/centos/business-process/README.md | 87 +++++++++++ dockerfiles/centos/integrator/README.md | 94 ++++++++++++ dockerfiles/centos/micro-integrator/README.md | 83 +++++++++++ dockerfiles/centos/msf4j/README.md | 83 +++++++++++ dockerfiles/ubuntu/README.md | 140 ------------------ dockerfiles/ubuntu/analytics/README.md | 110 ++++++++++++++ dockerfiles/ubuntu/broker/README.md | 88 +++++++++++ dockerfiles/ubuntu/business-process/README.md | 86 +++++++++++ dockerfiles/ubuntu/integrator/README.md | 86 +++++++++++ dockerfiles/ubuntu/micro-integrator/README.md | 82 ++++++++++ dockerfiles/ubuntu/msf4j/README.md | 82 ++++++++++ 21 files changed, 1615 insertions(+), 418 deletions(-) delete mode 100644 dockerfiles/alpine/README.md create mode 100644 dockerfiles/alpine/analytics/README.md create mode 100644 dockerfiles/alpine/broker/README.md create mode 100644 dockerfiles/alpine/business-process/README.md create mode 100644 dockerfiles/alpine/integrator/README.md create mode 100644 dockerfiles/alpine/micro-integrator/README.md create mode 100644 dockerfiles/alpine/msf4j/README.md delete mode 100644 dockerfiles/centos/README.md create mode 100644 dockerfiles/centos/analytics/README.md create mode 100644 dockerfiles/centos/broker/README.md create mode 100644 dockerfiles/centos/business-process/README.md create mode 100644 dockerfiles/centos/integrator/README.md create mode 100644 dockerfiles/centos/micro-integrator/README.md create mode 100644 dockerfiles/centos/msf4j/README.md delete mode 100644 dockerfiles/ubuntu/README.md create mode 100644 dockerfiles/ubuntu/analytics/README.md create mode 100644 dockerfiles/ubuntu/broker/README.md create mode 100644 dockerfiles/ubuntu/business-process/README.md create mode 100644 dockerfiles/ubuntu/integrator/README.md create mode 100644 dockerfiles/ubuntu/micro-integrator/README.md create mode 100644 dockerfiles/ubuntu/msf4j/README.md diff --git a/dockerfiles/alpine/README.md b/dockerfiles/alpine/README.md deleted file mode 100644 index 3da497ff..00000000 --- a/dockerfiles/alpine/README.md +++ /dev/null @@ -1,138 +0,0 @@ -# Dockerfiles for WSO2 Enterprise Integrator # - -This section defines the step-by-step instructions to build [Alpine](https://hub.docker.com/_/alpine/) Linux based Docker images for multiple profiles -provided by WSO2 Enterprise Integrator 6.4.0, namely:
- -1. Integrator -2. Micro integrator -3. Business Process -4. Broker -5. MSF4J -6. Analytics Dashboard -7. Analytics Worker - -## Prerequisites -* [Docker](https://www.docker.com/get-docker) v17.09.0 or above - -## How to build an image and run - -##### 1. Checkout this repository into your local machine using the following git command. - -``` -git clone https://github.com/wso2/docker-ei.git -``` - ->The local copy of the `dockerfiles/alpine` directory will be referred to as `DOCKERFILE_HOME` from this point onwards. - -##### 2. Add WSO2 Enterprise Integrator distribution and required libraries. - -- Download [WSO2 Enterprise Integrator 6.4.0 distribution](https://wso2.com/integration/) and -extract into `/base/files`. -- Once the WSO2 Enterprise Integrator distribution is extracted, it should be as follows: -``` -/base/files/jdk -/base/files/wso2ei-6.4.0 -``` -- Download [MySQL Connector/J](https://downloads.mysql.com/archives/c-j/) v5.1.45 and then copy that to `/base/files`,`/analytics/dashboard/files`and `/analytics/worker/files` folder -- Download [Andes Client](http://maven.wso2.org/nexus/content/groups/wso2-public/org/wso2/andes/wso2/andes-client/3.2.82/) JAR v3.2.82, -[Geronimo JMS Spec](http://maven.wso2.org/nexus/content/groups/wso2-public/org/apache/geronimo/specs/wso2/geronimo-jms_1.1_spec/1.1.0.wso2v1/) JAR v1.1.0.wso2v1 and -[Secure-vault](http://maven.wso2.org/nexus/content/groups/wso2-public/org/wso2/securevault/org.wso2.securevault/1.0.0-wso2v2/) JAR v.1.0.0-wso2v2
to -`/integrator/files`. These libraries are needed for the communication between Integrator
and Message Broker. -- If you intend to use the Docker images with Kubernetes clustered product deployments, download the -[Kubernetes membership scheme](http://central.maven.org/maven2/org/wso2/carbon/kubernetes/artifacts/kubernetes-membership-scheme/1.0.5/kubernetes-membership-scheme-1.0.5.jar) -and [dnsjava for DNS lookups](http://central.maven.org/maven2/dnsjava/dnsjava/2.1.8/dnsjava-2.1.8.jar) JAR artifacts and copy them to -`/base/files` folder. - ->Please refer to [WSO2 Update Manager documentation]( https://docs.wso2.com/display/WUM300/WSO2+Update+Manager) -in order to obtain latest bug fixes and updates for the product. - -##### 3. Build the base Docker image. -- For base, navigate to `/base` directory.
- Execute `docker build` command as shown below. - + `docker build -t wso2ei-base:6.4.0-alpine .` - -##### 4. Build Docker images specific to each profile. -- For Integrator, navigate to `/integrator` directory.
- Execute `docker build` command as shown below. - + `docker build -t wso2ei-integrator:6.4.0-alpine .` -- For Micro Integrator, navigate to `/micro-integrator` directory.
- Execute `docker build` command as shown below. - + `docker build -t wso2ei-micro-integrator:6.4.0-alpine .` -- For Business Process Server, navigate to `/business-process` directory.
- Execute `docker build` command as shown below. - + `docker build -t wso2ei-business-process:6.4.0-alpine .` -- For Message Broker, navigate to `/broker` directory.
- Execute `docker build` command as shown below. - + `docker build -t wso2ei-broker:6.4.0-alpine .` -- For MSF4J, navigate to `/msf4j` directory.
- Execute `docker build` command as shown below. - + `docker build -t wso2ei-msf4j:6.4.0-alpine .` -- For Analytics Dashboard, navigate to `/analytics/dashboard` directory.
- Execute `docker build` command as shown below. - + `docker build -t wso2ei-analytics-dashboard:6.4.0-alpine .` -- For Analytics Worker, navigate to `/analytics/worker` directory.
- Execute `docker build` command as shown below. - + `docker build -t wso2ei-analytics-worker:6.4.0-alpine .` - -##### 5. Running docker images specific to each profile. -- For Integrator, - + `docker run -p 8280:8280 -p 8243:8243 -p 9443:9443 wso2ei-integrator:6.4.0-alpine` -- For Micro Integrator, - + `docker run -p 8290:8290 -p 8253:8253 wso2ei-micro-integrator:6.4.0-alpine` -- For Business Process Server, - + `docker run -p 9445:9445 -p 9765:9765 wso2ei-business-process:6.4.0-alpine` -- For Message Broker, - + `docker run -p 9446:9446 -p 5675:5675 ...all-port-mappings-here... wso2ei-broker:6.4.0-alpine` -- For MSF4J, - + `docker run -p 9090:9090 wso2ei-msf4j:6.4.0-alpine` -- For Analytics Dashboard, - + `docker run -p 9713:9713 -p 9643:9643 ...all-port-mappings-here... wso2ei-analytics-dashboard:6.4.0-alpine` -- for Analytics Worker, - + `docker run -p 9444:9444 ...all-port-mappings-here... wso2ei-analytics-worker:6.4.0-alpine` - -##### 6. Accessing management console per each profile. -- For Integrator, - + `https::9443/carbon` -- For Business Process Server, - + `https::9445/carbon` -- For Message Broker, - + `https::9446/carbon` -- For Analytics Dashboard, - + Business Rules:
- `https://:9643/business-rules` - + Portal:
- `https://:9643/portal` - + Monitoring:
- `https://:9643/monitoring` - ->In here, refers to hostname or IP of the host machine on top of which containers are spawned. - -## How to update configurations -Configurations would lie on the Docker host machine and they can be volume mounted to the container.
-As an example, steps required to change the port offset of Integrator profile using `carbon.xml` is as follows. - -##### 1. Stop the integrator container if it's already running. -In WSO2 Enterprise Integrator 6.4.0 product distribution, carbon.xml file for the integrator profile
-can be found at `/conf`. Copy the file to some suitable location of the host machine,
-referred to as `/carbon.xml` and change the offset value under ports to 1. - -##### 2. Grant read permission to `other` users for `/carbon.xml` -``` -chmod o+r /carbon.xml -``` - -##### 3. Run the image by mounting the file to container as follows. -``` -docker run --p 8281:8281 -p 8244:8244 -p 9444:9444 ---volume /carbon.xml:/carbon.xml -wso2ei-integrator:6.4.0-alpine -``` - ->In here, refers to /home/wso2carbon/wso2ei-6.4.0/conf folder of the container. - -## Docker command usage references - -* [Docker build command reference](https://docs.docker.com/engine/reference/commandline/build/) -* [Docker run command reference](https://docs.docker.com/engine/reference/run/) -* [Dockerfile reference](https://docs.docker.com/engine/reference/builder/) diff --git a/dockerfiles/alpine/analytics/README.md b/dockerfiles/alpine/analytics/README.md new file mode 100644 index 00000000..d93d8678 --- /dev/null +++ b/dockerfiles/alpine/analytics/README.md @@ -0,0 +1,110 @@ +# Dockerfile for WSO2 Enterprise Integrator Analytics # + +This section defines the step-by-step instructions to build [Alpine](https://hub.docker.com/_/alpine/) Linux based Docker images for multiple profiles +provided by WSO2 Enterprise Integrator 6.4.0, namely:
+ +1. Dashboard +2. Worker + +## Prerequisites + +* [Docker](https://www.docker.com/get-docker) v17.09.0 or above + +## How to build an image and run +##### 1. Checkout this repository into your local machine using the following Git command. + +``` +git clone https://github.com/wso2/docker-ei.git +``` + +>The local copy of the `dockerfile/alpine/analytics` directory will be referred to as `ANALYTICS_DOCKERFILE_HOME` from this point onwards. + + +##### 2. Add Analytics profile distribution and MySQL connector to `/base/files`. + +- Download [WSO2 Enterprise Integrator 6.4.0 distribution](https://wso2.com/integration/) distribution. +Extract the product distribution and execute the `/bin/profile-creator.sh` to generate the Micro Integrator +profile distribution. + +``` +.//bin/profile-creator.sh +``` + +Extract the generated profile distribution to `/base/files`. + +- Download [MySQL Connector/J](https://downloads.mysql.com/archives/c-j) +and copy that to `/base/files`. +- Once all of these are in place, it should look as follows: + + ```bash + /base/files/wso2ei-6.4.0/ + /base/files/mysql-connector-java--bin.jar + ``` + +>Please refer to [WSO2 Update Manager documentation]( https://docs.wso2.com/display/WUM300/WSO2+Update+Manager) +in order to obtain latest bug fixes and updates for the product. + +##### 3. Build the base Docker image. + +- For base, navigate to `/base` directory.
+ Execute `docker build` command as shown below. + + `docker build -t wso2ei-analytics-base:6.4.0-alpine .` + +##### 4. Build Docker images specific to each profile. + +- For dashboard, navigate to `/dashboard` directory.
+ Execute `docker build` command as shown below. + + `docker build -t wso2ei-analytics-dashboard:6.4.0-alpine .` +- For worker, navigate to `/worker` directory.
+ Execute `docker build` command as shown below. + + `docker build -t wso2ei-analytics-worker:6.4.0-alpine .` + +##### 5. Running Docker images specific to each profile. + +- For dashboard, + + `docker run -p 9713:9713 -p 9643:9643 ...all-port-mappings-here... wso2ei-analytics-dashboard:6.4.0-alpine` +- For worker, + + `docker run -p 9444:9444 ...all-port-mappings-here... wso2ei-analytics-worker:6.4.0-alpine` + +##### 6. Accessing the Dashboard portal. + +- For Analytics Dashboard, + + Business Rules:
+ `https://:9643/business-rules` + + Portal:
+ `https://:9643/portal` + + Monitoring:
+ `https://:9643/monitoring` + +>In here, refers to hostname or IP of the host machine on top of which containers are spawned. + +## How to update configurations +Configurations would lie on the Docker host machine and they can be volume mounted to the container.
+As an example, steps required to change the port offset using `deployment.yaml` is as follows. + +##### 1. Stop the Enterprise Integrator Analytics container if it's already running. +In WSO2 Enterprise Integrator 6.4.0 product distribution, `deployment.yaml` configuration file
+can be found at `/wso2/analytics/conf/worker`. Copy the file to some suitable location of the host machine,
+referred to as `/deployment.yaml` and change the offset value under ports to 2. + +##### 2. Grant read permission to `other` users for `/deployment.yaml` +``` +chmod o+r /deployment.yaml +``` + +##### 3. Run the image by mounting the file to container as follows. +``` +docker run +-p 9444:9444 +--volume /deployment.yaml:/deployment.yaml +wso2ei-analytics-worker:6.4.0-alpine +``` + +>In here, refers to /home/wso2carbon/wso2ei-6.4.0/wso2/analytics/conf/worker folder of the container. + + +## Docker command usage references + +* [Docker build command reference](https://docs.docker.com/engine/reference/commandline/build/) +* [Docker run command reference](https://docs.docker.com/engine/reference/run/) +* [Dockerfile reference](https://docs.docker.com/engine/reference/builder/) diff --git a/dockerfiles/alpine/broker/README.md b/dockerfiles/alpine/broker/README.md new file mode 100644 index 00000000..213d3cb8 --- /dev/null +++ b/dockerfiles/alpine/broker/README.md @@ -0,0 +1,88 @@ +# Dockerfile for Broker profile of WSO2 Enterprise Integrator # +This section defines the step-by-step instructions to build an [Alpine](https://hub.docker.com/_/alpine/) Linux based Docker image +Broker profile for WSO2 Enterprise Integrator 6.4.0. + +## Prerequisites + +* [Docker](https://www.docker.com/get-docker) v17.09.0 or above + + +## How to build an image and run +##### 1. Checkout this repository into your local machine using the following Git command. +``` +git clone https://github.com/wso2/docker-ei.git +``` + +>The local copy of the `dockerfiles/alpine/broker` directory will be referred to as `BROKER_DOCKERFILE_HOME` from this point onwards. + +##### 2. Add Broker profile distribution and MySQL connector to `/files`. + +- Download [WSO2 Enterprise Integrator 6.4.0 distribution](https://wso2.com/integration/) distribution. +Extract the product distribution and execute the `/bin/profile-creator.sh` to generate the Broker +profile distribution. + +``` +.//bin/profile-creator.sh +``` + +Extract the generated profile distribution to `/files`. + +- Download [MySQL Connector/J](https://downloads.mysql.com/archives/c-j) +and copy that to `/files`. +- Once all of these are in place, it should look as follows: + + ```bash + /files/wso2ei-6.4.0/ + /files/mysql-connector-java--bin.jar + ``` + +>Please refer to [WSO2 Update Manager documentation]( https://docs.wso2.com/display/WUM300/WSO2+Update+Manager) +in order to obtain latest bug fixes and updates for the product. + +##### 3. Build the Docker image. +- Navigate to `` directory.
+ Execute `docker build` command as shown below. + + `docker build -t wso2ei-broker:6.4.0-alpine .` + +##### 4. Running the Docker image. +- `docker run -p 9446:9446 ...all-port-mappings-here... wso2ei-broker:6.4.0-alpine` +>Here, only port 9446 (HTTPS servlet transport) has been mapped to a Docker host port. +You may map other container service ports, which have been exposed to Docker host ports, as desired. + +##### 5. Accessing management console. +- To access the management console, use the docker host IP and port 9446. + + `https::9446/carbon` + +>In here, refers to hostname or IP of the host machine on top of which containers are spawned. + + +## How to update configurations +Configurations would lie on the Docker host machine and they can be volume mounted to the container.
+As an example, steps required to change the port offset using `carbon.xml` is as follows. + +##### 1. Stop the Broker profile container if it's already running. +In Broker profile product distribution, `carbon.xml` configuration file can be found at `/wso2/broker/conf`. +Copy the file to some suitable location of the host machine, referred to as `/carbon.xml` and change +the offset value under ports to 1. + +##### 2. Grant read permission to `other` users for `/carbon.xml` +``` +chmod o+r /carbon.xml +``` + +##### 3. Run the image by mounting the file to container as follows. +``` +docker run \ +-p 9446:9446 \ +--volume /carbon.xml:/carbon.xml \ +wso2ei-broker:6.4.0-alpine +``` + +>In here, refers to /home/wso2carbon/wso2ei-6.4.0/wso2/broker/conf folder of the container. + + +## Docker command usage references + +* [Docker build command reference](https://docs.docker.com/engine/reference/commandline/build/) +* [Docker run command reference](https://docs.docker.com/engine/reference/run/) +* [Dockerfile reference](https://docs.docker.com/engine/reference/builder/) diff --git a/dockerfiles/alpine/business-process/README.md b/dockerfiles/alpine/business-process/README.md new file mode 100644 index 00000000..ac2f0d45 --- /dev/null +++ b/dockerfiles/alpine/business-process/README.md @@ -0,0 +1,86 @@ +# Dockerfile for Business Process Server profile of WSO2 Enterprise Integrator # +This section defines the step-by-step instructions to build an [Alpine](https://hub.docker.com/_/alpine/) Linux based Docker image +Business Process Server profile for WSO2 Enterprise Integrator 6.4.0. + +## Prerequisites + +* [Docker](https://www.docker.com/get-docker) v17.09.0 or above + +## How to build an image and run +##### 1. Checkout this repository into your local machine using the following Git command. +``` +git clone https://github.com/wso2/docker-ei.git +``` + +>The local copy of the `dockerfiles/alpine/business-process` directory will be referred to as `BPS_DOCKERFILE_HOME` from this point onwards. + +##### 2. Add Business Process Server distribution and MySQL connector to `/files`. + +- Download [WSO2 Enterprise Integrator 6.4.0 distribution](https://wso2.com/integration/) distribution. +Extract the product distribution and execute the `/bin/profile-creator.sh` to generate the Business Process Server +profile distribution. + +``` +.//bin/profile-creator.sh +``` + +Extract the generated profile distribution to `/files`. + +- Download [MySQL Connector/J](https://downloads.mysql.com/archives/c-j) +and copy that to `/files`. +- Once all of these are in place, it should look as follows: + + ```bash + /files/wso2ei-6.4.0/ + /files/mysql-connector-java--bin.jar + ``` + +>Please refer to [WSO2 Update Manager documentation]( https://docs.wso2.com/display/WUM300/WSO2+Update+Manager) +in order to obtain latest bug fixes and updates for the product. + +##### 3. Build the Docker image. +- Navigate to `` directory.
+ Execute `docker build` command as shown below. + + `docker build -t wso2ei-business-process:6.4.0-alpine .` + +##### 4. Running the Docker image. +- `docker run -p 9445:9445 ...all-port-mappings-here... wso2ei-business-process:6.4.0-alpine` +>Here, only port 9445 (HTTPS servlet transport) has been mapped to a Docker host port. +You may map other container service ports, which have been exposed to Docker host ports, as desired. + +##### 5. Accessing management console. +- To access the management console, use the docker host IP and port 9445. + + `https::9445/carbon` + +>In here, refers to hostname or IP of the host machine on top of which containers are spawned. + +## How to update configurations +Configurations would lie on the Docker host machine and they can be volume mounted to the container.
+As an example, steps required to change the port offset using `carbon.xml` is as follows. + +##### 1. Stop the Broker profile container if it's already running. +In Business Process Server profile product distribution, `carbon.xml` configuration file can be found at `/wso2/business-process/conf`. +Copy the file to some suitable location of the host machine, referred to as `/carbon.xml` and change +the offset value under ports to 1. + +##### 2. Grant read permission to `other` users for `/carbon.xml` +``` +chmod o+r /carbon.xml +``` + +##### 3. Run the image by mounting the file to container as follows. +``` +docker run \ +-p 9445:9445 \ +--volume /carbon.xml:/carbon.xml \ +wso2ei-business-process:6.4.0-alpine +``` + +>In here, refers to /home/wso2carbon/wso2ei-6.4.0/wso2/business-process/conf folder of the container. + + +## Docker command usage references + +* [Docker build command reference](https://docs.docker.com/engine/reference/commandline/build/) +* [Docker run command reference](https://docs.docker.com/engine/reference/run/) +* [Dockerfile reference](https://docs.docker.com/engine/reference/builder/) diff --git a/dockerfiles/alpine/integrator/README.md b/dockerfiles/alpine/integrator/README.md new file mode 100644 index 00000000..578bd7ac --- /dev/null +++ b/dockerfiles/alpine/integrator/README.md @@ -0,0 +1,86 @@ +# Dockerfile for Integrator profile of WSO2 Enterprise Integrator # +This section defines the step-by-step instructions to build an [Alpine](https://hub.docker.com/_/alpine/) Linux based Docker image +Integrator profile for WSO2 Enterprise Integrator 6.4.0. + +## Prerequisites + +* [Docker](https://www.docker.com/get-docker) v17.09.0 or above + + +## How to build an image and run +##### 1. Checkout this repository into your local machine using the following Git command. +``` +git clone https://github.com/wso2/docker-ei.git +``` + +>The local copy of the `dockerfiles/alpine/integrator` directory will be referred to as `INTEGRATOR_DOCKERFILE_HOME` from this point onwards. + +##### 2. Add Integrator profile distribution and MySQL connector to `/files`. + +- Download [WSO2 Enterprise Integrator 6.4.0 distribution](https://wso2.com/integration/) distribution. +Extract the product distribution and execute the `/bin/profile-creator.sh` to generate the Integrator +profile distribution. + +``` +.//bin/profile-creator.sh +``` + +Extract the generated profile distribution to `/files`. + +- Download [MySQL Connector/J](https://downloads.mysql.com/archives/c-j) +and copy that to `/files`. +- Once all of these are in place, it should look as follows: + + ```bash + /files/wso2ei-6.4.0/ + /files/mysql-connector-java--bin.jar + ``` + +>Please refer to [WSO2 Update Manager documentation]( https://docs.wso2.com/display/WUM300/WSO2+Update+Manager) +in order to obtain latest bug fixes and updates for the product. + +##### 3. Build the Docker image. +- Navigate to `` directory.
+ Execute `docker build` command as shown below. + + `docker build -t wso2ei-integrator:6.4.0-alpine .` + +##### 4. Running the Docker image. +- `docker run -p 8280:8280 -p 8243:8243 -p 9443:9443 wso2ei-integrator:6.4.0-alpine` + +##### 5. Accessing management console. +- To access the management console, use the docker host IP and port 9443. + + `https::9443/carbon` + +>In here, refers to hostname or IP of the host machine on top of which containers are spawned. + + +## How to update configurations +Configurations would lie on the Docker host machine and they can be volume mounted to the container.
+As an example, steps required to change the port offset using `carbon.xml` is as follows. + +##### 1. Stop the Broker profile container if it's already running. +In Integrator profile product distribution, `carbon.xml` configuration file can be found at `/conf`. +Copy the file to some suitable location of the host machine, referred to as `/carbon.xml` and change +the offset value under ports to 1. + +##### 2. Grant read permission to `other` users for `/carbon.xml` +``` +chmod o+r /carbon.xml +``` + +##### 3. Run the image by mounting the file to container as follows. +``` +docker run \ +-p 9443:9443 \ +--volume /carbon.xml:/carbon.xml \ +wso2ei-integrator:6.4.0-alpine +``` + +>In here, refers to /home/wso2carbon/wso2ei-6.4.0/conf folder of the container. + + +## Docker command usage references + +* [Docker build command reference](https://docs.docker.com/engine/reference/commandline/build/) +* [Docker run command reference](https://docs.docker.com/engine/reference/run/) +* [Dockerfile reference](https://docs.docker.com/engine/reference/builder/) diff --git a/dockerfiles/alpine/micro-integrator/README.md b/dockerfiles/alpine/micro-integrator/README.md new file mode 100644 index 00000000..4942a0fc --- /dev/null +++ b/dockerfiles/alpine/micro-integrator/README.md @@ -0,0 +1,82 @@ +# Dockerfile for Micro Integrator profile of WSO2 Enterprise Integrator # +This section defines the step-by-step instructions to build an [Alpine](https://hub.docker.com/_/alpine/) Linux based Docker image +Micro Integrator profile for WSO2 Enterprise Integrator 6.4.0. + +## Prerequisites + +* [Docker](https://www.docker.com/get-docker) v17.09.0 or above + + +## How to build an image and run +##### 1. Checkout this repository into your local machine using the following Git command. +``` +git clone https://github.com/wso2/docker-ei.git +``` + +>The local copy of the `dockerfiles/alpine/micro-integrator` directory will be referred to as `MICRO_ESB_DOCKERFILE_HOME` from this point onwards. + +##### 2. Add Micro Integrator profile distribution and MySQL connector to `/files`. + +- Download [WSO2 Enterprise Integrator 6.4.0 distribution](https://wso2.com/integration/) distribution. +Extract the product distribution and execute the `/bin/profile-creator.sh` to generate the Micro Integrator +profile distribution. + +``` +.//bin/profile-creator.sh +``` + +Extract the generated profile distribution to `/files`. + +- Download [MySQL Connector/J](https://downloads.mysql.com/archives/c-j) +and copy that to `/files`. +- Once all of these are in place, it should look as follows: + + ```bash + /files/wso2ei-6.4.0/ + /files/mysql-connector-java--bin.jar + ``` + +>Please refer to [WSO2 Update Manager documentation]( https://docs.wso2.com/display/WUM300/WSO2+Update+Manager) +in order to obtain latest bug fixes and updates for the product. + +##### 3. Build the Docker image. +- Navigate to `` directory.
+ Execute `docker build` command as shown below. + + `docker build -t wso2ei-micro-integrator:6.4.0-alpine .` + +##### 4. Running the Docker image. +- `docker run -p 8290:8290 -p 8253:8253 wso2ei-micro-integrator:6.4.0-alpine` + +>In here, refers to hostname or IP of the host machine on top of which containers are spawned. + + +## How to update configurations +Configurations would lie on the Docker host machine and they can be volume mounted to the container.
+As an example, steps required to change the port offset using `carbon.xml` is as follows. + +##### 1. Stop the Micro Integrator profile container if it's already running. +In Micro Integrator profile product distribution, `carbon.xml` configuration file can be found at `/wso2/micro-integrator/conf`. +Copy the file to some suitable location of the host machine, referred to as `/carbon.xml` and change +the offset value under ports to 1. + +##### 2. Grant read permission to `other` users for `/carbon.xml` +``` +chmod o+r /carbon.xml +``` + +##### 3. Run the image by mounting the file to container as follows. +``` +docker run \ +-p 8290:8290 -p 8253:8253 \ +--volume /carbon.xml:/carbon.xml \ +wso2ei-micro-integrator:6.4.0-alpine +``` + +>In here, refers to /home/wso2carbon/wso2ei-6.4.0/wso2/micro-integrator/conf folder of the container. + + +## Docker command usage references + +* [Docker build command reference](https://docs.docker.com/engine/reference/commandline/build/) +* [Docker run command reference](https://docs.docker.com/engine/reference/run/) +* [Dockerfile reference](https://docs.docker.com/engine/reference/builder/) diff --git a/dockerfiles/alpine/msf4j/README.md b/dockerfiles/alpine/msf4j/README.md new file mode 100644 index 00000000..ca589a26 --- /dev/null +++ b/dockerfiles/alpine/msf4j/README.md @@ -0,0 +1,82 @@ +# Dockerfile for MSF4J profile of WSO2 Enterprise Integrator # +This section defines the step-by-step instructions to build an [Alpine](https://hub.docker.com/_/alpine/) Linux based Docker image +MSF4J profile for WSO2 Enterprise Integrator 6.4.0. + +## Prerequisites + +* [Docker](https://www.docker.com/get-docker) v17.09.0 or above + + +## How to build an image and run +##### 1. Checkout this repository into your local machine using the following Git command. +``` +git clone https://github.com/wso2/docker-ei.git +``` + +>The local copy of the `dockerfiles/alpine/msf4j` directory will be referred to as `MSF4J_DOCKERFILE_HOME` from this point onwards. + +##### 2. Add MSF4J profile distribution and MySQL connector to `/files`. + +- Download [WSO2 Enterprise Integrator 6.4.0 distribution](https://wso2.com/integration/) distribution. +Extract the product distribution and execute the `/bin/profile-creator.sh` to generate the MSF4J +profile distribution. + +``` +.//bin/profile-creator.sh +``` + +Extract the generated profile distribution to `/files`. + +- Download [MySQL Connector/J](https://downloads.mysql.com/archives/c-j) +and copy that to `/files`. +- Once all of these are in place, it should look as follows: + + ```bash + /files/wso2ei-6.4.0/ + /files/mysql-connector-java--bin.jar + ``` + +>Please refer to [WSO2 Update Manager documentation]( https://docs.wso2.com/display/WUM300/WSO2+Update+Manager) +in order to obtain latest bug fixes and updates for the product. + +##### 3. Build the Docker image. +- Navigate to `` directory.
+ Execute `docker build` command as shown below. + + `docker build -t wso2ei-msf4j:6.4.0-alpine .` + +##### 4. Running the Docker image. +- `docker run -p 9090:9090 wso2ei-msf4j:6.4.0-alpine` + +>In here, refers to hostname or IP of the host machine on top of which containers are spawned. + + +## How to update configurations +Configurations would lie on the Docker host machine and they can be volume mounted to the container.
+As an example, steps required to change the port offset using `carbon.xml` is as follows. + +##### 1. Stop the Micro Integrator profile container if it's already running. +In MSF4J profile product distribution, `carbon.yml` configuration file can be found at `/wso2/msf4j/conf`. +Copy the file to some suitable location of the host machine, referred to as `/carbon.yml` and change +the offset value under ports to 1. + +##### 2. Grant read permission to `other` users for `/carbon.yml` +``` +chmod o+r /carbon.yml +``` + +##### 3. Run the image by mounting the file to container as follows. +``` +docker run \ +-p 9090:9090 \ +--volume /carbon.yml:/carbon.yml \ +wso2ei-msf4j:6.4.0-alpine +``` + +>In here, refers to /home/wso2carbon/wso2ei-6.4.0/wso2/msf4j/conf folder of the container. + + +## Docker command usage references + +* [Docker build command reference](https://docs.docker.com/engine/reference/commandline/build/) +* [Docker run command reference](https://docs.docker.com/engine/reference/run/) +* [Dockerfile reference](https://docs.docker.com/engine/reference/builder/) diff --git a/dockerfiles/centos/README.md b/dockerfiles/centos/README.md deleted file mode 100644 index c8e3c7ed..00000000 --- a/dockerfiles/centos/README.md +++ /dev/null @@ -1,140 +0,0 @@ -# Dockerfiles for WSO2 Enterprise Integrator # - -This section defines the step-by-step instructions to build [CentOS](https://hub.docker.com/_/centos/) Linux based Docker images for multiple profiles -provided by WSO2 Enterprise Integrator 6.4.0, namely:
- -1. Integrator -2. Micro integrator -3. Business Process -4. Broker -5. MSF4J -6. Analytics Dashboard -7. Analytics Worker - -## Prerequisites -* [Docker](https://www.docker.com/get-docker) v17.09.0 or above - -## How to build an image and run - -##### 1. Checkout this repository into your local machine using the following git command. - -``` -git clone https://github.com/wso2/docker-ei.git -``` - ->The local copy of the `dockerfiles/centos` directory will be referred to as `DOCKERFILE_HOME` from this point onwards. - -##### 2. Add JDK, WSO2 Enterprise Integrator distribution and required libraries. - -- Download [JDK 1.8](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) and -extract into `/base/files`. -- Download [WSO2 Enterprise Integrator 6.4.0 distribution](https://wso2.com/integration/) and -extract into `/base/files`. -- Once both JDK and WSO2 Enterprise Integrator distribution are extracted, it should be as follows: -``` -/base/files/jdk -/base/files/wso2ei-6.4.0 -``` -- Download [MySQL Connector/J](https://downloads.mysql.com/archives/c-j/) v5.1.45 and then copy that to `/base/files`,`/analytics/dashboard/files`and `/analytics/worker/files` folder -- Download [Andes Client](http://maven.wso2.org/nexus/content/groups/wso2-public/org/wso2/andes/wso2/andes-client/3.2.82/) JAR v3.2.82, -[Geronimo JMS Spec](http://maven.wso2.org/nexus/content/groups/wso2-public/org/apache/geronimo/specs/wso2/geronimo-jms_1.1_spec/1.1.0.wso2v1/) JAR v1.1.0.wso2v1 and -[Secure-vault](http://maven.wso2.org/nexus/content/groups/wso2-public/org/wso2/securevault/org.wso2.securevault/1.0.0-wso2v2/) JAR v.1.0.0-wso2v2
to -`/integrator/files`. These libraries are needed for the communication between Integrator
and Message Broker. -- If you intend to use the Docker images with Kubernetes clustered product deployments, download the -[Kubernetes membership scheme](http://central.maven.org/maven2/org/wso2/carbon/kubernetes/artifacts/kubernetes-membership-scheme/1.0.5/kubernetes-membership-scheme-1.0.5.jar) -and [dnsjava for DNS lookups](http://central.maven.org/maven2/dnsjava/dnsjava/2.1.8/dnsjava-2.1.8.jar) JAR artifacts and copy them to -`/base/files` folder. - ->Please refer to [WSO2 Update Manager documentation]( https://docs.wso2.com/display/WUM300/WSO2+Update+Manager) -in order to obtain latest bug fixes and updates for the product. - -##### 3. Build the base Docker image. -- For base, navigate to `/base` directory.
- Execute `docker build` command as shown below. - + `docker build -t wso2ei-base:6.4.0-centos .` - -##### 4. Build Docker images specific to each profile. -- For Integrator, navigate to `/integrator` directory.
- Execute `docker build` command as shown below. - + `docker build -t wso2ei-integrator:6.4.0-centos .` -- For Micro Integrator, navigate to `/micro-integrator` directory.
- Execute `docker build` command as shown below. - + `docker build -t wso2ei-micro-integrator:6.4.0-centos .` -- For Business Process Server, navigate to `/business-process` directory.
- Execute `docker build` command as shown below. - + `docker build -t wso2ei-business-process:6.4.0-centos .` -- For Message Broker, navigate to `/broker` directory.
- Execute `docker build` command as shown below. - + `docker build -t wso2ei-broker:6.4.0-centos .` -- For MSF4J, navigate to `/msf4j` directory.
- Execute `docker build` command as shown below. - + `docker build -t wso2ei-msf4j:6.4.0-centos .` -- For Analytics Dashboard, navigate to `/analytics/dashboard` directory.
- Execute `docker build` command as shown below. - + `docker build -t wso2ei-analytics-dashboard:6.4.0-centos .` -- For Analytics Worker, navigate to `/analytics/worker` directory.
- Execute `docker build` command as shown below. - + `docker build -t wso2ei-analytics-worker:6.4.0-centos .` - -##### 5. Running docker images specific to each profile. -- For Integrator, - + `docker run -p 8280:8280 -p 8243:8243 -p 9443:9443 wso2ei-integrator:6.4.0-centos` -- For Micro Integrator, - + `docker run -p 8290:8290 -p 8253:8253 wso2ei-micro-integrator:6.4.0-centos` -- For Business Process Server, - + `docker run -p 9445:9445 -p 9765:9765 wso2ei-business-process:6.4.0-centos` -- For Message Broker, - + `docker run -p 9446:9446 -p 5675:5675 ...all-port-mappings-here... wso2ei-broker:6.4.0-centos` -- For MSF4J, - + `docker run -p 9090:9090 wso2ei-msf4j:6.4.0-centos` -- For Analytics Dashboard, - + `docker run -p 9713:9713 -p 9643:9643 ...all-port-mappings-here... wso2ei-analytics-dashboard:6.4.0-centos` -- for Analytics Worker, - + `docker run -p 9444:9444 ...all-port-mappings-here... wso2ei-analytics-worker:6.4.0-centos` - -##### 6. Accessing management console per each profile. -- For Integrator, - + `https::9443/carbon` -- For Business Process Server, - + `https::9445/carbon` -- For Message Broker, - + `https::9446/carbon` -- For Analytics Dashboard, - + Business Rules:
- `https://:9643/business-rules` - + Portal:
- `https://:9643/portal` - + Monitoring:
- `https://:9643/monitoring` - ->In here, refers to hostname or IP of the host machine on top of which containers are spawned. - -## How to update configurations -Configurations would lie on the Docker host machine and they can be volume mounted to the container.
-As an example, steps required to change the port offset of Integrator profile using `carbon.xml` is as follows. - -##### 1. Stop the integrator container if it's already running. -In WSO2 Enterprise Integrator 6.4.0 product distribution, carbon.xml file for the integrator profile
-can be found at `/conf`. Copy the file to some suitable location of the host machine,
-referred to as `/carbon.xml` and change the offset value under ports to 1. - -##### 2. Grant read permission to `other` users for `/carbon.xml` -``` -chmod o+r /carbon.xml -``` - -##### 3. Run the image by mounting the file to container as follows. -``` -docker run --p 8281:8281 -p 8244:8244 -p 9444:9444 ---volume /carbon.xml:/carbon.xml -wso2ei-integrator:6.4.0-centos -``` - ->In here, refers to /home/wso2carbon/wso2ei-6.4.0/conf folder of the container. - -## Docker command usage references - -* [Docker build command reference](https://docs.docker.com/engine/reference/commandline/build/) -* [Docker run command reference](https://docs.docker.com/engine/reference/run/) -* [Dockerfile reference](https://docs.docker.com/engine/reference/builder/) diff --git a/dockerfiles/centos/analytics/README.md b/dockerfiles/centos/analytics/README.md new file mode 100644 index 00000000..3c8c467d --- /dev/null +++ b/dockerfiles/centos/analytics/README.md @@ -0,0 +1,111 @@ +# Dockerfile for WSO2 Enterprise Integrator Analytics # + +This section defines the step-by-step instructions to build [CentOS](https://hub.docker.com/_/centos/) Linux based Docker images for multiple profiles +provided by WSO2 Enterprise Integrator 6.4.0, namely:
+ +1. Dashboard +2. Worker + +## Prerequisites + +* [Docker](https://www.docker.com/get-docker) v17.09.0 or above + +## How to build an image and run +##### 1. Checkout this repository into your local machine using the following Git command. + +``` +git clone https://github.com/wso2/docker-ei.git +``` + +>The local copy of the `dockerfile/centos/analytics` directory will be referred to as `ANALYTICS_DOCKERFILE_HOME` from this point onwards. + + +##### 2. Add Analytics profile distribution and MySQL connector to `/base/files`. + +- Download [AdoptOpenJDK 8](https://adoptopenjdk.net/) and extract it to `/files`. +- Download [WSO2 Enterprise Integrator 6.4.0 distribution](https://wso2.com/integration/) distribution. +Extract the product distribution and execute the `/bin/profile-creator.sh` to generate the Micro Integrator +profile distribution. + +``` +.//bin/profile-creator.sh +``` + +Extract the generated profile distribution to `/base/files`. + +- Download [MySQL Connector/J](https://downloads.mysql.com/archives/c-j) +and copy that to `/base/files`. +- Once all of these are in place, it should look as follows: + + ```bash + /base/files/wso2ei-6.4.0/ + /base/files/mysql-connector-java--bin.jar + ``` + +>Please refer to [WSO2 Update Manager documentation]( https://docs.wso2.com/display/WUM300/WSO2+Update+Manager) +in order to obtain latest bug fixes and updates for the product. + +##### 3. Build the base Docker image. + +- For base, navigate to `/base` directory.
+ Execute `docker build` command as shown below. + + `docker build -t wso2ei-analytics-base:6.4.0-centos .` + +##### 4. Build Docker images specific to each profile. + +- For dashboard, navigate to `/dashboard` directory.
+ Execute `docker build` command as shown below. + + `docker build -t wso2ei-analytics-dashboard:6.4.0-centos .` +- For worker, navigate to `/worker` directory.
+ Execute `docker build` command as shown below. + + `docker build -t wso2ei-analytics-worker:6.4.0-centos .` + +##### 5. Running Docker images specific to each profile. + +- For dashboard, + + `docker run -p 9713:9713 -p 9643:9643 ...all-port-mappings-here... wso2ei-analytics-dashboard:6.4.0-centos` +- For worker, + + `docker run -p 9444:9444 ...all-port-mappings-here... wso2ei-analytics-worker:6.4.0-centos` + +##### 6. Accessing the Dashboard portal. + +- For Analytics Dashboard, + + Business Rules:
+ `https://:9643/business-rules` + + Portal:
+ `https://:9643/portal` + + Monitoring:
+ `https://:9643/monitoring` + +>In here, refers to hostname or IP of the host machine on top of which containers are spawned. + +## How to update configurations +Configurations would lie on the Docker host machine and they can be volume mounted to the container.
+As an example, steps required to change the port offset using `deployment.yaml` is as follows. + +##### 1. Stop the Enterprise Integrator Analytics container if it's already running. +In WSO2 Enterprise Integrator 6.4.0 product distribution, `deployment.yaml` configuration file
+can be found at `/wso2/analytics/conf/worker`. Copy the file to some suitable location of the host machine,
+referred to as `/deployment.yaml` and change the offset value under ports to 2. + +##### 2. Grant read permission to `other` users for `/deployment.yaml` +``` +chmod o+r /deployment.yaml +``` + +##### 3. Run the image by mounting the file to container as follows. +``` +docker run +-p 9444:9444 +--volume /deployment.yaml:/deployment.yaml +wso2ei-analytics-worker:6.4.0-centos +``` + +>In here, refers to /home/wso2carbon/wso2ei-6.4.0/wso2/analytics/conf/worker folder of the container. + + +## Docker command usage references + +* [Docker build command reference](https://docs.docker.com/engine/reference/commandline/build/) +* [Docker run command reference](https://docs.docker.com/engine/reference/run/) +* [Dockerfile reference](https://docs.docker.com/engine/reference/builder/) diff --git a/dockerfiles/centos/broker/README.md b/dockerfiles/centos/broker/README.md new file mode 100644 index 00000000..6b4c791a --- /dev/null +++ b/dockerfiles/centos/broker/README.md @@ -0,0 +1,89 @@ +# Dockerfile for Broker profile of WSO2 Enterprise Integrator # +This section defines the step-by-step instructions to build an [CentOS](https://hub.docker.com/_/centos/) Linux based Docker image +Broker profile for WSO2 Enterprise Integrator 6.4.0. + +## Prerequisites + +* [Docker](https://www.docker.com/get-docker) v17.09.0 or above + + +## How to build an image and run +##### 1. Checkout this repository into your local machine using the following Git command. +``` +git clone https://github.com/wso2/docker-ei.git +``` + +>The local copy of the `dockerfiles/centos/broker` directory will be referred to as `BROKER_DOCKERFILE_HOME` from this point onwards. + +##### 2. Add Broker profile distribution and MySQL connector to `/files`. + +- Download [AdoptOpenJDK 8](https://adoptopenjdk.net/) and extract it to `/files`. +- Download [WSO2 Enterprise Integrator 6.4.0 distribution](https://wso2.com/integration/) distribution. +Extract the product distribution and execute the `/bin/profile-creator.sh` to generate the Broker +profile distribution. + +``` +.//bin/profile-creator.sh +``` + +Extract the generated profile distribution to `/files`. + +- Download [MySQL Connector/J](https://downloads.mysql.com/archives/c-j) +and copy that to `/files`. +- Once all of these are in place, it should look as follows: + + ```bash + /files/wso2ei-6.4.0/ + /files/mysql-connector-java--bin.jar + ``` + +>Please refer to [WSO2 Update Manager documentation]( https://docs.wso2.com/display/WUM300/WSO2+Update+Manager) +in order to obtain latest bug fixes and updates for the product. + +##### 3. Build the Docker image. +- Navigate to `` directory.
+ Execute `docker build` command as shown below. + + `docker build -t wso2ei-broker:6.4.0-centos .` + +##### 4. Running the Docker image. +- `docker run -p 9446:9446 ...all-port-mappings-here... wso2ei-broker:6.4.0` +>Here, only port 9446 (HTTPS servlet transport) has been mapped to a Docker host port. +You may map other container service ports, which have been exposed to Docker host ports, as desired. + +##### 5. Accessing management console. +- To access the management console, use the docker host IP and port 9446. + + `https::9446/carbon` + +>In here, refers to hostname or IP of the host machine on top of which containers are spawned. + + +## How to update configurations +Configurations would lie on the Docker host machine and they can be volume mounted to the container.
+As an example, steps required to change the port offset using `carbon.xml` is as follows. + +##### 1. Stop the Broker profile container if it's already running. +In Broker profile product distribution, `carbon.xml` configuration file can be found at `/wso2/broker/conf`. +Copy the file to some suitable location of the host machine, referred to as `/carbon.xml` and change +the offset value under ports to 1. + +##### 2. Grant read permission to `other` users for `/carbon.xml` +``` +chmod o+r /carbon.xml +``` + +##### 3. Run the image by mounting the file to container as follows. +``` +docker run \ +-p 9446:9446 \ +--volume /carbon.xml:/carbon.xml \ +wso2ei-broker:6.4.0-centos +``` + +>In here, refers to /home/wso2carbon/wso2ei-6.4.0/wso2/broker/conf folder of the container. + + +## Docker command usage references + +* [Docker build command reference](https://docs.docker.com/engine/reference/commandline/build/) +* [Docker run command reference](https://docs.docker.com/engine/reference/run/) +* [Dockerfile reference](https://docs.docker.com/engine/reference/builder/) diff --git a/dockerfiles/centos/business-process/README.md b/dockerfiles/centos/business-process/README.md new file mode 100644 index 00000000..b1fb45a4 --- /dev/null +++ b/dockerfiles/centos/business-process/README.md @@ -0,0 +1,87 @@ +# Dockerfile for Business Process Server profile of WSO2 Enterprise Integrator # +This section defines the step-by-step instructions to build an [CentOS](https://hub.docker.com/_/centos/) Linux based Docker image +Business Process Server profile for WSO2 Enterprise Integrator 6.4.0. + +## Prerequisites + +* [Docker](https://www.docker.com/get-docker) v17.09.0 or above + +## How to build an image and run +##### 1. Checkout this repository into your local machine using the following Git command. +``` +git clone https://github.com/wso2/docker-ei.git +``` + +>The local copy of the `dockerfiles/centos/business-process` directory will be referred to as `BPS_DOCKERFILE_HOME` from this point onwards. + +##### 2. Add Business Process Server distribution and MySQL connector to `/files`. + +- Download [AdoptOpenJDK 8](https://adoptopenjdk.net/) and extract it to `/files`. +- Download [WSO2 Enterprise Integrator 6.4.0 distribution](https://wso2.com/integration/) distribution. +Extract the product distribution and execute the `/bin/profile-creator.sh` to generate the Business Process Server +profile distribution. + +``` +.//bin/profile-creator.sh +``` + +Extract the generated profile distribution to `/files`. + +- Download [MySQL Connector/J](https://downloads.mysql.com/archives/c-j) +and copy that to `/files`. +- Once all of these are in place, it should look as follows: + + ```bash + /files/wso2ei-6.4.0/ + /files/mysql-connector-java--bin.jar + ``` + +>Please refer to [WSO2 Update Manager documentation]( https://docs.wso2.com/display/WUM300/WSO2+Update+Manager) +in order to obtain latest bug fixes and updates for the product. + +##### 3. Build the Docker image. +- Navigate to `` directory.
+ Execute `docker build` command as shown below. + + `docker build -t wso2ei-business-process:6.4.0-centos .` + +##### 4. Running the Docker image. +- `docker run -p 9445:9445 ...all-port-mappings-here... wso2ei-business-process:6.4.0-centos` +>Here, only port 9445 (HTTPS servlet transport) has been mapped to a Docker host port. +You may map other container service ports, which have been exposed to Docker host ports, as desired. + +##### 5. Accessing management console. +- To access the management console, use the docker host IP and port 9445. + + `https::9445/carbon` + +>In here, refers to hostname or IP of the host machine on top of which containers are spawned. + +## How to update configurations +Configurations would lie on the Docker host machine and they can be volume mounted to the container.
+As an example, steps required to change the port offset using `carbon.xml` is as follows. + +##### 1. Stop the Broker profile container if it's already running. +In Business Process Server profile product distribution, `carbon.xml` configuration file can be found at `/wso2/business-process/conf`. +Copy the file to some suitable location of the host machine, referred to as `/carbon.xml` and change +the offset value under ports to 1. + +##### 2. Grant read permission to `other` users for `/carbon.xml` +``` +chmod o+r /carbon.xml +``` + +##### 3. Run the image by mounting the file to container as follows. +``` +docker run \ +-p 9445:9445 \ +--volume /carbon.xml:/carbon.xml \ +wso2ei-business-process:6.4.0-centos +``` + +>In here, refers to /home/wso2carbon/wso2ei-6.4.0/wso2/business-process/conf folder of the container. + + +## Docker command usage references + +* [Docker build command reference](https://docs.docker.com/engine/reference/commandline/build/) +* [Docker run command reference](https://docs.docker.com/engine/reference/run/) +* [Dockerfile reference](https://docs.docker.com/engine/reference/builder/) diff --git a/dockerfiles/centos/integrator/README.md b/dockerfiles/centos/integrator/README.md new file mode 100644 index 00000000..eba24867 --- /dev/null +++ b/dockerfiles/centos/integrator/README.md @@ -0,0 +1,94 @@ +# Dockerfile for Integrator profile of WSO2 Enterprise Integrator # +This section defines the step-by-step instructions to build an [CentOS](https://hub.docker.com/_/centos/) Linux based Docker image +Integrator profile for WSO2 Enterprise Integrator 6.4.0. + +## Prerequisites + +* [Docker](https://www.docker.com/get-docker) v17.09.0 or above + + +## How to build an image and run +##### 1. Checkout this repository into your local machine using the following Git command. +``` +git clone https://github.com/wso2/docker-ei.git +``` + +>The local copy of the `dockerfiles/centos/integrator` directory will be referred to as `INTEGRATOR_DOCKERFILE_HOME` from this point onwards. + +##### 2. Add Integrator profile distribution and MySQL connector to `/files`. + +- Download [AdoptOpenJDK 8](https://adoptopenjdk.net/) and extract it to `/files`. +- Download [WSO2 Enterprise Integrator 6.4.0 distribution](https://wso2.com/integration/) distribution. +Extract the product distribution and execute the `/bin/profile-creator.sh` to generate the Integrator +profile distribution. + +``` +.//bin/profile-creator.sh +``` + +Extract the generated profile distribution to `/files`. + +- Download [MySQL Connector/J](https://downloads.mysql.com/archives/c-j) +and copy that to `/files`. +- Download [Andes Client](http://maven.wso2.org/nexus/content/groups/wso2-public/org/wso2/andes/wso2/andes-client/3.2.82/) JAR v3.2.82, +[Geronimo JMS Spec](http://maven.wso2.org/nexus/content/groups/wso2-public/org/apache/geronimo/specs/wso2/geronimo-jms_1.1_spec/1.1.0.wso2v1/) JAR v1.1.0.wso2v1 and +[Secure-vault](http://maven.wso2.org/nexus/content/groups/wso2-public/org/wso2/securevault/org.wso2.securevault/1.0.0-wso2v2/) JAR v.1.0.0-wso2v2
to +`/files/lib`. These libraries are needed for the communication between Integrator
and Message Broker. +- Once all of these are in place, it should look as follows: + + ```bash + /files/wso2ei-6.4.0/ + /files/mysql-connector-java--bin.jar + /files/lib/andes-client-3.2.82.jar + /files/lib/geronimo-jms_1.1_spec-1.1.0.wso2v1.jar + /files/lib/org.wso2.securevault-1.0.0-wso2v2-sources.jar + ``` + +>Please refer to [WSO2 Update Manager documentation]( https://docs.wso2.com/display/WUM300/WSO2+Update+Manager) +in order to obtain latest bug fixes and updates for the product. + +##### 3. Build the Docker image. +- Navigate to `` directory.
+ Execute `docker build` command as shown below. + + `docker build -t wso2ei-integrator:6.4.0-centos .` + +##### 4. Running the Docker image. +- `docker run -p 8280:8280 -p 8243:8243 -p 9443:9443 wso2ei-integrator:6.4.0-centos` + +##### 5. Accessing management console. +- To access the management console, use the docker host IP and port 9443. + + `https::9443/carbon` + +>In here, refers to hostname or IP of the host machine on top of which containers are spawned. + + +## How to update configurations +Configurations would lie on the Docker host machine and they can be volume mounted to the container.
+As an example, steps required to change the port offset using `carbon.xml` is as follows. + +##### 1. Stop the Broker profile container if it's already running. +In Integrator profile product distribution, `carbon.xml` configuration file can be found at `/conf`. +Copy the file to some suitable location of the host machine, referred to as `/carbon.xml` and change +the offset value under ports to 1. + +##### 2. Grant read permission to `other` users for `/carbon.xml` +``` +chmod o+r /carbon.xml +``` + +##### 3. Run the image by mounting the file to container as follows. +``` +docker run \ +-p 9443:9443 \ +--volume /carbon.xml:/carbon.xml \ +wso2ei-integrator:6.4.0-centos +``` + +>In here, refers to /home/wso2carbon/wso2ei-6.4.0/conf folder of the container. + + +## Docker command usage references + +* [Docker build command reference](https://docs.docker.com/engine/reference/commandline/build/) +* [Docker run command reference](https://docs.docker.com/engine/reference/run/) +* [Dockerfile reference](https://docs.docker.com/engine/reference/builder/) diff --git a/dockerfiles/centos/micro-integrator/README.md b/dockerfiles/centos/micro-integrator/README.md new file mode 100644 index 00000000..f26f770a --- /dev/null +++ b/dockerfiles/centos/micro-integrator/README.md @@ -0,0 +1,83 @@ +# Dockerfile for Micro Integrator profile of WSO2 Enterprise Integrator # +This section defines the step-by-step instructions to build an [CentOS](https://hub.docker.com/_/centos/) Linux based Docker image +Micro Integrator profile for WSO2 Enterprise Integrator 6.4.0. + +## Prerequisites + +* [Docker](https://www.docker.com/get-docker) v17.09.0 or above + + +## How to build an image and run +##### 1. Checkout this repository into your local machine using the following Git command. +``` +git clone https://github.com/wso2/docker-ei.git +``` + +>The local copy of the `dockerfiles/centos/micro-integrator` directory will be referred to as `MICRO_ESB_DOCKERFILE_HOME` from this point onwards. + +##### 2. Add Micro Integrator profile distribution and MySQL connector to `/files`. + +- Download [AdoptOpenJDK 8](https://adoptopenjdk.net/) and extract it to `/files`. +- Download [WSO2 Enterprise Integrator 6.4.0 distribution](https://wso2.com/integration/) distribution. +Extract the product distribution and execute the `/bin/profile-creator.sh` to generate the Micro Integrator +profile distribution. + +``` +.//bin/profile-creator.sh +``` + +Extract the generated profile distribution to `/files`. + +- Download [MySQL Connector/J](https://downloads.mysql.com/archives/c-j) +and copy that to `/files`. +- Once all of these are in place, it should look as follows: + + ```bash + /files/wso2ei-6.4.0/ + /files/mysql-connector-java--bin.jar + ``` + +>Please refer to [WSO2 Update Manager documentation]( https://docs.wso2.com/display/WUM300/WSO2+Update+Manager) +in order to obtain latest bug fixes and updates for the product. + +##### 3. Build the Docker image. +- Navigate to `` directory.
+ Execute `docker build` command as shown below. + + `docker build -t wso2ei-micro-integrator:6.4.0-centos .` + +##### 4. Running the Docker image. +- `docker run -p 8290:8290 -p 8253:8253 wso2ei-micro-integrator:6.4.0-centos` + +>In here, refers to hostname or IP of the host machine on top of which containers are spawned. + + +## How to update configurations +Configurations would lie on the Docker host machine and they can be volume mounted to the container.
+As an example, steps required to change the port offset using `carbon.xml` is as follows. + +##### 1. Stop the Micro Integrator profile container if it's already running. +In Micro Integrator profile product distribution, `carbon.xml` configuration file can be found at `/wso2/micro-integrator/conf`. +Copy the file to some suitable location of the host machine, referred to as `/carbon.xml` and change +the offset value under ports to 1. + +##### 2. Grant read permission to `other` users for `/carbon.xml` +``` +chmod o+r /carbon.xml +``` + +##### 3. Run the image by mounting the file to container as follows. +``` +docker run \ +-p 8290:8290 -p 8253:8253 \ +--volume /carbon.xml:/carbon.xml \ +wso2ei-micro-integrator:6.4.0-centos +``` + +>In here, refers to /home/wso2carbon/wso2ei-6.4.0/wso2/micro-integrator/conf folder of the container. + + +## Docker command usage references + +* [Docker build command reference](https://docs.docker.com/engine/reference/commandline/build/) +* [Docker run command reference](https://docs.docker.com/engine/reference/run/) +* [Dockerfile reference](https://docs.docker.com/engine/reference/builder/) diff --git a/dockerfiles/centos/msf4j/README.md b/dockerfiles/centos/msf4j/README.md new file mode 100644 index 00000000..0d6ed82e --- /dev/null +++ b/dockerfiles/centos/msf4j/README.md @@ -0,0 +1,83 @@ +# Dockerfile for MSF4J profile of WSO2 Enterprise Integrator # +This section defines the step-by-step instructions to build an [CentOS](https://hub.docker.com/_/centos/) Linux based Docker image +MSF4J profile for WSO2 Enterprise Integrator 6.4.0. + +## Prerequisites + +* [Docker](https://www.docker.com/get-docker) v17.09.0 or above + + +## How to build an image and run +##### 1. Checkout this repository into your local machine using the following Git command. +``` +git clone https://github.com/wso2/docker-ei.git +``` + +>The local copy of the `dockerfiles/centos/msf4j` directory will be referred to as `MSF4J_DOCKERFILE_HOME` from this point onwards. + +##### 2. Add MSF4J profile distribution and MySQL connector to `/files`. + +- Download [AdoptOpenJDK 8](https://adoptopenjdk.net/) and extract it to `/files`. +- Download [WSO2 Enterprise Integrator 6.4.0 distribution](https://wso2.com/integration/) distribution. +Extract the product distribution and execute the `/bin/profile-creator.sh` to generate the MSF4J +profile distribution. + +``` +.//bin/profile-creator.sh +``` + +Extract the generated profile distribution to `/files`. + +- Download [MySQL Connector/J](https://downloads.mysql.com/archives/c-j) +and copy that to `/files`. +- Once all of these are in place, it should look as follows: + + ```bash + /files/wso2ei-6.4.0/ + /files/mysql-connector-java--bin.jar + ``` + +>Please refer to [WSO2 Update Manager documentation]( https://docs.wso2.com/display/WUM300/WSO2+Update+Manager) +in order to obtain latest bug fixes and updates for the product. + +##### 3. Build the Docker image. +- Navigate to `` directory.
+ Execute `docker build` command as shown below. + + `docker build -t wso2ei-msf4j:6.4.0-centos .` + +##### 4. Running the Docker image. +- `docker run -p 9090:9090 wso2ei-msf4j:6.4.0-centos` + +>In here, refers to hostname or IP of the host machine on top of which containers are spawned. + + +## How to update configurations +Configurations would lie on the Docker host machine and they can be volume mounted to the container.
+As an example, steps required to change the port offset using `carbon.xml` is as follows. + +##### 1. Stop the Micro Integrator profile container if it's already running. +In MSF4J profile product distribution, `carbon.yml` configuration file can be found at `/wso2/msf4j/conf`. +Copy the file to some suitable location of the host machine, referred to as `/carbon.yml` and change +the offset value under ports to 1. + +##### 2. Grant read permission to `other` users for `/carbon.yml` +``` +chmod o+r /carbon.yml +``` + +##### 3. Run the image by mounting the file to container as follows. +``` +docker run \ +-p 9090:9090 \ +--volume /carbon.yml:/carbon.yml \ +wso2ei-msf4j:6.4.0-centos +``` + +>In here, refers to /home/wso2carbon/wso2ei-6.4.0/wso2/msf4j/conf folder of the container. + + +## Docker command usage references + +* [Docker build command reference](https://docs.docker.com/engine/reference/commandline/build/) +* [Docker run command reference](https://docs.docker.com/engine/reference/run/) +* [Dockerfile reference](https://docs.docker.com/engine/reference/builder/) diff --git a/dockerfiles/ubuntu/README.md b/dockerfiles/ubuntu/README.md deleted file mode 100644 index 6d867577..00000000 --- a/dockerfiles/ubuntu/README.md +++ /dev/null @@ -1,140 +0,0 @@ -# Dockerfiles for WSO2 Enterprise Integrator # - -This section defines the step-by-step instructions to build [Ubuntu](https://hub.docker.com/_/ubuntu/) Linux based Docker images for multiple profiles -provided by WSO2 Enterprise Integrator 6.4.0, namely:
- -1. Integrator -2. Micro integrator -3. Business Process -4. Broker -5. MSF4J -6. Analytics Dashboard -7. Analytics Worker - -## Prerequisites -* [Docker](https://www.docker.com/get-docker) v17.09.0 or above - -## How to build an image and run - -##### 1. Checkout this repository into your local machine using the following git command. - -``` -git clone https://github.com/wso2/docker-ei.git -``` - ->The local copy of the `dockerfiles/ubuntu` directory will be referred to as `DOCKERFILE_HOME` from this point onwards. - -##### 2. Add JDK, WSO2 Enterprise Integrator distribution and required libraries. - -- Download [JDK 1.8](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) and -extract into `/base/files`. -- Download [WSO2 Enterprise Integrator 6.4.0 distribution](https://wso2.com/integration/) and -extract into `/base/files`. -- Once both JDK and WSO2 Enterprise Integrator distribution are extracted, it should be as follows: -``` -/base/files/jdk -/base/files/wso2ei-6.4.0 -``` -- Download [MySQL Connector/J](https://downloads.mysql.com/archives/c-j/) v5.1.45 and then copy that to `/base/files`,`/analytics/dashboard/files`and `/analytics/worker/files` folder -- Download [Andes Client](http://maven.wso2.org/nexus/content/groups/wso2-public/org/wso2/andes/wso2/andes-client/3.2.82/) JAR v3.2.82, -[Geronimo JMS Spec](http://maven.wso2.org/nexus/content/groups/wso2-public/org/apache/geronimo/specs/wso2/geronimo-jms_1.1_spec/1.1.0.wso2v1/) JAR v1.1.0.wso2v1 and -[Secure-vault](http://maven.wso2.org/nexus/content/groups/wso2-public/org/wso2/securevault/org.wso2.securevault/1.0.0-wso2v2/) JAR v.1.0.0-wso2v2
to -`/integrator/files`. These libraries are needed for the communication between Integrator
and Message Broker. -- If you intend to use the Docker images with Kubernetes clustered product deployments, download the -[Kubernetes membership scheme](http://central.maven.org/maven2/org/wso2/carbon/kubernetes/artifacts/kubernetes-membership-scheme/1.0.5/kubernetes-membership-scheme-1.0.5.jar) -and [dnsjava for DNS lookups](http://central.maven.org/maven2/dnsjava/dnsjava/2.1.8/dnsjava-2.1.8.jar) JAR artifacts and copy them to -`/base/files` folder. - ->Please refer to [WSO2 Update Manager documentation]( https://docs.wso2.com/display/WUM300/WSO2+Update+Manager) -in order to obtain latest bug fixes and updates for the product. - -##### 3. Build the base Docker image. -- For base, navigate to `/base` directory.
- Execute `docker build` command as shown below. - + `docker build -t wso2ei-base:6.4.0 .` - -##### 4. Build Docker images specific to each profile. -- For Integrator, navigate to `/integrator` directory.
- Execute `docker build` command as shown below. - + `docker build -t wso2ei-integrator:6.4.0 .` -- For Micro Integrator, navigate to `/micro-integrator` directory.
- Execute `docker build` command as shown below. - + `docker build -t wso2ei-micro-integrator:6.4.0 .` -- For Business Process Server, navigate to `/business-process` directory.
- Execute `docker build` command as shown below. - + `docker build -t wso2ei-business-process:6.4.0 .` -- For Message Broker, navigate to `/broker` directory.
- Execute `docker build` command as shown below. - + `docker build -t wso2ei-broker:6.4.0 .` -- For MSF4J, navigate to `/msf4j` directory.
- Execute `docker build` command as shown below. - + `docker build -t wso2ei-msf4j:6.4.0 .` -- For Analytics Dashboard, navigate to `/analytics/dashboard` directory.
- Execute `docker build` command as shown below. - + `docker build -t wso2ei-analytics-dashboard:6.4.0 .` -- For Analytics Worker, navigate to `/analytics/worker` directory.
- Execute `docker build` command as shown below. - + `docker build -t wso2ei-analytics-worker:6.4.0 .` - -##### 5. Running docker images specific to each profile. -- For Integrator, - + `docker run -p 8280:8280 -p 8243:8243 -p 9443:9443 wso2ei-integrator:6.4.0` -- For Micro Integrator, - + `docker run -p 8290:8290 -p 8253:8253 wso2ei-micro-integrator:6.4.0` -- For Business Process Server, - + `docker run -p 9445:9445 -p 9765:9765 wso2ei-business-process:6.4.0` -- For Message Broker, - + `docker run -p 9446:9446 -p 5675:5675 ...all-port-mappings-here... wso2ei-broker:6.4.0` -- For MSF4J, - + `docker run -p 9090:9090 wso2ei-msf4j:6.4.0` -- For Analytics Dashboard, - + `docker run -p 9713:9713 -p 9643:9643 ...all-port-mappings-here... wso2ei-analytics-dashboard:6.4.0` -- for Analytics Worker, - + `docker run -p 9444:9444 ...all-port-mappings-here... wso2ei-analytics-worker:6.4.0` - -##### 6. Accessing management console per each profile. -- For Integrator, - + `https::9443/carbon` -- For Business Process Server, - + `https::9445/carbon` -- For Message Broker, - + `https::9446/carbon` -- For Analytics Dashboard, - + Business Rules:
- `https://:9643/business-rules` - + Portal:
- `https://:9643/portal` - + Monitoring:
- `https://:9643/monitoring` - ->In here, refers to hostname or IP of the host machine on top of which containers are spawned. - -## How to update configurations -Configurations would lie on the Docker host machine and they can be volume mounted to the container.
-As an example, steps required to change the port offset of Integrator profile using `carbon.xml` is as follows. - -##### 1. Stop the integrator container if it's already running. -In WSO2 Enterprise Integrator 6.4.0 product distribution, carbon.xml file for the integrator profile
-can be found at `/conf`. Copy the file to some suitable location of the host machine,
-referred to as `/carbon.xml` and change the offset value under ports to 1. - -##### 2. Grant read permission to `other` users for `/carbon.xml` -``` -chmod o+r /carbon.xml -``` - -##### 3. Run the image by mounting the file to container as follows. -``` -docker run --p 8281:8281 -p 8244:8244 -p 9444:9444 ---volume /carbon.xml:/carbon.xml -wso2ei-integrator:6.4.0 -``` - ->In here, refers to /home/wso2carbon/wso2ei-6.4.0/conf folder of the container. - -## Docker command usage references - -* [Docker build command reference](https://docs.docker.com/engine/reference/commandline/build/) -* [Docker run command reference](https://docs.docker.com/engine/reference/run/) -* [Dockerfile reference](https://docs.docker.com/engine/reference/builder/) diff --git a/dockerfiles/ubuntu/analytics/README.md b/dockerfiles/ubuntu/analytics/README.md new file mode 100644 index 00000000..85862a63 --- /dev/null +++ b/dockerfiles/ubuntu/analytics/README.md @@ -0,0 +1,110 @@ +# Dockerfile for WSO2 Enterprise Integrator Analytics # + +This section defines the step-by-step instructions to build [Ubuntu](https://hub.docker.com/_/ubuntu/) Linux based Docker images for multiple profiles +provided by WSO2 Enterprise Integrator 6.4.0, namely:
+ +1. Dashboard +2. Worker + +## Prerequisites + +* [Docker](https://www.docker.com/get-docker) v17.09.0 or above + +## How to build an image and run +##### 1. Checkout this repository into your local machine using the following Git command. + +``` +git clone https://github.com/wso2/docker-ei.git +``` + +>The local copy of the `dockerfile/ubuntu/analytics` directory will be referred to as `ANALYTICS_DOCKERFILE_HOME` from this point onwards. + + +##### 2. Add Analytics profile distribution and MySQL connector to `/base/files`. + +- Download [WSO2 Enterprise Integrator 6.4.0 distribution](https://wso2.com/integration/) distribution. +Extract the product distribution and execute the `/bin/profile-creator.sh` to generate the Micro Integrator +profile distribution. + +``` +.//bin/profile-creator.sh +``` + +Extract the generated profile distribution to `/base/files`. + +- Download [MySQL Connector/J](https://downloads.mysql.com/archives/c-j) +and copy that to `/base/files`. +- Once all of these are in place, it should look as follows: + + ```bash + /base/files/wso2ei-6.4.0/ + /base/files/mysql-connector-java--bin.jar + ``` + +>Please refer to [WSO2 Update Manager documentation]( https://docs.wso2.com/display/WUM300/WSO2+Update+Manager) +in order to obtain latest bug fixes and updates for the product. + +##### 3. Build the base Docker image. + +- For base, navigate to `/base` directory.
+ Execute `docker build` command as shown below. + + `docker build -t wso2ei-analytics-base:6.4.0 .` + +##### 4. Build Docker images specific to each profile. + +- For dashboard, navigate to `/dashboard` directory.
+ Execute `docker build` command as shown below. + + `docker build -t wso2ei-analytics-dashboard:6.4.0 .` +- For worker, navigate to `/worker` directory.
+ Execute `docker build` command as shown below. + + `docker build -t wso2ei-analytics-worker:6.4.0 .` + +##### 5. Running Docker images specific to each profile. + +- For dashboard, + + `docker run -p 9713:9713 -p 9643:9643 ...all-port-mappings-here... wso2ei-analytics-dashboard:6.4.0` +- For worker, + + `docker run -p 9444:9444 ...all-port-mappings-here... wso2ei-analytics-worker:6.4.0` + +##### 6. Accessing the Dashboard portal. + +- For Analytics Dashboard, + + Business Rules:
+ `https://:9643/business-rules` + + Portal:
+ `https://:9643/portal` + + Monitoring:
+ `https://:9643/monitoring` + +>In here, refers to hostname or IP of the host machine on top of which containers are spawned. + +## How to update configurations +Configurations would lie on the Docker host machine and they can be volume mounted to the container.
+As an example, steps required to change the port offset using `deployment.yaml` is as follows. + +##### 1. Stop the Enterprise Integrator Analytics container if it's already running. +In WSO2 Enterprise Integrator 6.4.0 product distribution, `deployment.yaml` configuration file
+can be found at `/wso2/analytics/conf/worker`. Copy the file to some suitable location of the host machine,
+referred to as `/deployment.yaml` and change the offset value under ports to 2. + +##### 2. Grant read permission to `other` users for `/deployment.yaml` +``` +chmod o+r /deployment.yaml +``` + +##### 3. Run the image by mounting the file to container as follows. +``` +docker run +-p 9444:9444 +--volume /deployment.yaml:/deployment.yaml +wso2ei-analytics-worker:6.4.0 +``` + +>In here, refers to /home/wso2carbon/wso2ei-6.4.0/wso2/analytics/conf/worker folder of the container. + + +## Docker command usage references + +* [Docker build command reference](https://docs.docker.com/engine/reference/commandline/build/) +* [Docker run command reference](https://docs.docker.com/engine/reference/run/) +* [Dockerfile reference](https://docs.docker.com/engine/reference/builder/) diff --git a/dockerfiles/ubuntu/broker/README.md b/dockerfiles/ubuntu/broker/README.md new file mode 100644 index 00000000..9841e43c --- /dev/null +++ b/dockerfiles/ubuntu/broker/README.md @@ -0,0 +1,88 @@ +# Dockerfile for Broker profile of WSO2 Enterprise Integrator # +This section defines the step-by-step instructions to build an [Ubuntu](https://hub.docker.com/_/ubuntu/) Linux based Docker image +Broker profile for WSO2 Enterprise Integrator 6.4.0. + +## Prerequisites + +* [Docker](https://www.docker.com/get-docker) v17.09.0 or above + + +## How to build an image and run +##### 1. Checkout this repository into your local machine using the following Git command. +``` +git clone https://github.com/wso2/docker-ei.git +``` + +>The local copy of the `dockerfiles/ubuntu/broker` directory will be referred to as `BROKER_DOCKERFILE_HOME` from this point onwards. + +##### 2. Add Broker profile distribution and MySQL connector to `/files`. + +- Download [WSO2 Enterprise Integrator 6.4.0 distribution](https://wso2.com/integration/) distribution. +Extract the product distribution and execute the `/bin/profile-creator.sh` to generate the Broker +profile distribution. + +``` +.//bin/profile-creator.sh +``` + +Extract the generated profile distribution to `/files`. + +- Download [MySQL Connector/J](https://downloads.mysql.com/archives/c-j) +and copy that to `/files`. +- Once all of these are in place, it should look as follows: + + ```bash + /files/wso2ei-6.4.0/ + /files/mysql-connector-java--bin.jar + ``` + +>Please refer to [WSO2 Update Manager documentation]( https://docs.wso2.com/display/WUM300/WSO2+Update+Manager) +in order to obtain latest bug fixes and updates for the product. + +##### 3. Build the Docker image. +- Navigate to `` directory.
+ Execute `docker build` command as shown below. + + `docker build -t wso2ei-broker:6.4.0 .` + +##### 4. Running the Docker image. +- `docker run -p 9446:9446 ...all-port-mappings-here... wso2ei-broker:6.4.0` +>Here, only port 9446 (HTTPS servlet transport) has been mapped to a Docker host port. +You may map other container service ports, which have been exposed to Docker host ports, as desired. + +##### 5. Accessing management console. +- To access the management console, use the docker host IP and port 9446. + + `https::9446/carbon` + +>In here, refers to hostname or IP of the host machine on top of which containers are spawned. + + +## How to update configurations +Configurations would lie on the Docker host machine and they can be volume mounted to the container.
+As an example, steps required to change the port offset using `carbon.xml` is as follows. + +##### 1. Stop the Broker profile container if it's already running. +In Broker profile product distribution, `carbon.xml` configuration file can be found at `/wso2/broker/conf`. +Copy the file to some suitable location of the host machine, referred to as `/carbon.xml` and change +the offset value under ports to 1. + +##### 2. Grant read permission to `other` users for `/carbon.xml` +``` +chmod o+r /carbon.xml +``` + +##### 3. Run the image by mounting the file to container as follows. +``` +docker run \ +-p 9446:9446 \ +--volume /carbon.xml:/carbon.xml \ +wso2ei-broker:6.4.0 +``` + +>In here, refers to /home/wso2carbon/wso2ei-6.4.0/wso2/broker/conf folder of the container. + + +## Docker command usage references + +* [Docker build command reference](https://docs.docker.com/engine/reference/commandline/build/) +* [Docker run command reference](https://docs.docker.com/engine/reference/run/) +* [Dockerfile reference](https://docs.docker.com/engine/reference/builder/) diff --git a/dockerfiles/ubuntu/business-process/README.md b/dockerfiles/ubuntu/business-process/README.md new file mode 100644 index 00000000..4eef4d2f --- /dev/null +++ b/dockerfiles/ubuntu/business-process/README.md @@ -0,0 +1,86 @@ +# Dockerfile for Business Process Server profile of WSO2 Enterprise Integrator # +This section defines the step-by-step instructions to build an [Ubuntu](https://hub.docker.com/_/ubuntu/) Linux based Docker image +Business Process Server profile for WSO2 Enterprise Integrator 6.4.0. + +## Prerequisites + +* [Docker](https://www.docker.com/get-docker) v17.09.0 or above + +## How to build an image and run +##### 1. Checkout this repository into your local machine using the following Git command. +``` +git clone https://github.com/wso2/docker-ei.git +``` + +>The local copy of the `dockerfiles/ubuntu/business-process` directory will be referred to as `BPS_DOCKERFILE_HOME` from this point onwards. + +##### 2. Add Business Process Server distribution and MySQL connector to `/files`. + +- Download [WSO2 Enterprise Integrator 6.4.0 distribution](https://wso2.com/integration/) distribution. +Extract the product distribution and execute the `/bin/profile-creator.sh` to generate the Business Process Server +profile distribution. + +``` +.//bin/profile-creator.sh +``` + +Extract the generated profile distribution to `/files`. + +- Download [MySQL Connector/J](https://downloads.mysql.com/archives/c-j) +and copy that to `/files`. +- Once all of these are in place, it should look as follows: + + ```bash + /files/wso2ei-6.4.0/ + /files/mysql-connector-java--bin.jar + ``` + +>Please refer to [WSO2 Update Manager documentation]( https://docs.wso2.com/display/WUM300/WSO2+Update+Manager) +in order to obtain latest bug fixes and updates for the product. + +##### 3. Build the Docker image. +- Navigate to `` directory.
+ Execute `docker build` command as shown below. + + `docker build -t wso2ei-business-process:6.4.0 .` + +##### 4. Running the Docker image. +- `docker run -p 9445:9445 ...all-port-mappings-here... wso2ei-business-process:6.4.0` +>Here, only port 9445 (HTTPS servlet transport) has been mapped to a Docker host port. +You may map other container service ports, which have been exposed to Docker host ports, as desired. + +##### 5. Accessing management console. +- To access the management console, use the docker host IP and port 9445. + + `https::9445/carbon` + +>In here, refers to hostname or IP of the host machine on top of which containers are spawned. + +## How to update configurations +Configurations would lie on the Docker host machine and they can be volume mounted to the container.
+As an example, steps required to change the port offset using `carbon.xml` is as follows. + +##### 1. Stop the Broker profile container if it's already running. +In Business Process Server profile product distribution, `carbon.xml` configuration file can be found at `/wso2/business-process/conf`. +Copy the file to some suitable location of the host machine, referred to as `/carbon.xml` and change +the offset value under ports to 1. + +##### 2. Grant read permission to `other` users for `/carbon.xml` +``` +chmod o+r /carbon.xml +``` + +##### 3. Run the image by mounting the file to container as follows. +``` +docker run \ +-p 9445:9445 \ +--volume /carbon.xml:/carbon.xml \ +wso2ei-business-process:6.4.0 +``` + +>In here, refers to /home/wso2carbon/wso2ei-6.4.0/wso2/business-process/conf folder of the container. + + +## Docker command usage references + +* [Docker build command reference](https://docs.docker.com/engine/reference/commandline/build/) +* [Docker run command reference](https://docs.docker.com/engine/reference/run/) +* [Dockerfile reference](https://docs.docker.com/engine/reference/builder/) diff --git a/dockerfiles/ubuntu/integrator/README.md b/dockerfiles/ubuntu/integrator/README.md new file mode 100644 index 00000000..765a34f4 --- /dev/null +++ b/dockerfiles/ubuntu/integrator/README.md @@ -0,0 +1,86 @@ +# Dockerfile for Integrator profile of WSO2 Enterprise Integrator # +This section defines the step-by-step instructions to build an [Ubuntu](https://hub.docker.com/_/ubuntu/) Linux based Docker image +Integrator profile for WSO2 Enterprise Integrator 6.4.0. + +## Prerequisites + +* [Docker](https://www.docker.com/get-docker) v17.09.0 or above + + +## How to build an image and run +##### 1. Checkout this repository into your local machine using the following Git command. +``` +git clone https://github.com/wso2/docker-ei.git +``` + +>The local copy of the `dockerfiles/ubuntu/integrator` directory will be referred to as `INTEGRATOR_DOCKERFILE_HOME` from this point onwards. + +##### 2. Add Integrator profile distribution and MySQL connector to `/files`. + +- Download [WSO2 Enterprise Integrator 6.4.0 distribution](https://wso2.com/integration/) distribution. +Extract the product distribution and execute the `/bin/profile-creator.sh` to generate the Integrator +profile distribution. + +``` +.//bin/profile-creator.sh +``` + +Extract the generated profile distribution to `/files`. + +- Download [MySQL Connector/J](https://downloads.mysql.com/archives/c-j) +and copy that to `/files`. +- Once all of these are in place, it should look as follows: + + ```bash + /files/wso2ei-6.4.0/ + /files/mysql-connector-java--bin.jar + ``` + +>Please refer to [WSO2 Update Manager documentation]( https://docs.wso2.com/display/WUM300/WSO2+Update+Manager) +in order to obtain latest bug fixes and updates for the product. + +##### 3. Build the Docker image. +- Navigate to `` directory.
+ Execute `docker build` command as shown below. + + `docker build -t wso2ei-integrator:6.4.0 .` + +##### 4. Running the Docker image. +- `docker run -p 8280:8280 -p 8243:8243 -p 9443:9443 wso2ei-integrator:6.4.0` + +##### 5. Accessing management console. +- To access the management console, use the docker host IP and port 9443. + + `https::9443/carbon` + +>In here, refers to hostname or IP of the host machine on top of which containers are spawned. + + +## How to update configurations +Configurations would lie on the Docker host machine and they can be volume mounted to the container.
+As an example, steps required to change the port offset using `carbon.xml` is as follows. + +##### 1. Stop the Broker profile container if it's already running. +In Integrator profile product distribution, `carbon.xml` configuration file can be found at `/conf`. +Copy the file to some suitable location of the host machine, referred to as `/carbon.xml` and change +the offset value under ports to 1. + +##### 2. Grant read permission to `other` users for `/carbon.xml` +``` +chmod o+r /carbon.xml +``` + +##### 3. Run the image by mounting the file to container as follows. +``` +docker run \ +-p 9443:9443 \ +--volume /carbon.xml:/carbon.xml \ +wso2ei-integrator:6.4.0 +``` + +>In here, refers to /home/wso2carbon/wso2ei-6.4.0/conf folder of the container. + + +## Docker command usage references + +* [Docker build command reference](https://docs.docker.com/engine/reference/commandline/build/) +* [Docker run command reference](https://docs.docker.com/engine/reference/run/) +* [Dockerfile reference](https://docs.docker.com/engine/reference/builder/) diff --git a/dockerfiles/ubuntu/micro-integrator/README.md b/dockerfiles/ubuntu/micro-integrator/README.md new file mode 100644 index 00000000..7775fe3d --- /dev/null +++ b/dockerfiles/ubuntu/micro-integrator/README.md @@ -0,0 +1,82 @@ +# Dockerfile for Micro Integrator profile of WSO2 Enterprise Integrator # +This section defines the step-by-step instructions to build an [Ubuntu](https://hub.docker.com/_/ubuntu/) Linux based Docker image +Micro Integrator profile for WSO2 Enterprise Integrator 6.4.0. + +## Prerequisites + +* [Docker](https://www.docker.com/get-docker) v17.09.0 or above + + +## How to build an image and run +##### 1. Checkout this repository into your local machine using the following Git command. +``` +git clone https://github.com/wso2/docker-ei.git +``` + +>The local copy of the `dockerfiles/ubuntu/micro-integrator` directory will be referred to as `MICRO_ESB_DOCKERFILE_HOME` from this point onwards. + +##### 2. Add Micro Integrator profile distribution and MySQL connector to `/files`. + +- Download [WSO2 Enterprise Integrator 6.4.0 distribution](https://wso2.com/integration/) distribution. +Extract the product distribution and execute the `/bin/profile-creator.sh` to generate the Micro Integrator +profile distribution. + +``` +.//bin/profile-creator.sh +``` + +Extract the generated profile distribution to `/files`. + +- Download [MySQL Connector/J](https://downloads.mysql.com/archives/c-j) +and copy that to `/files`. +- Once all of these are in place, it should look as follows: + + ```bash + /files/wso2ei-6.4.0/ + /files/mysql-connector-java--bin.jar + ``` + +>Please refer to [WSO2 Update Manager documentation]( https://docs.wso2.com/display/WUM300/WSO2+Update+Manager) +in order to obtain latest bug fixes and updates for the product. + +##### 3. Build the Docker image. +- Navigate to `` directory.
+ Execute `docker build` command as shown below. + + `docker build -t wso2ei-micro-integrator:6.4.0 .` + +##### 4. Running the Docker image. +- `docker run -p 8290:8290 -p 8253:8253 wso2ei-micro-integrator:6.4.0` + +>In here, refers to hostname or IP of the host machine on top of which containers are spawned. + + +## How to update configurations +Configurations would lie on the Docker host machine and they can be volume mounted to the container.
+As an example, steps required to change the port offset using `carbon.xml` is as follows. + +##### 1. Stop the Micro Integrator profile container if it's already running. +In Micro Integrator profile product distribution, `carbon.xml` configuration file can be found at `/wso2/micro-integrator/conf`. +Copy the file to some suitable location of the host machine, referred to as `/carbon.xml` and change +the offset value under ports to 1. + +##### 2. Grant read permission to `other` users for `/carbon.xml` +``` +chmod o+r /carbon.xml +``` + +##### 3. Run the image by mounting the file to container as follows. +``` +docker run \ +-p 8290:8290 -p 8253:8253 \ +--volume /carbon.xml:/carbon.xml \ +wso2ei-micro-integrator:6.4.0 +``` + +>In here, refers to /home/wso2carbon/wso2ei-6.4.0/wso2/micro-integrator/conf folder of the container. + + +## Docker command usage references + +* [Docker build command reference](https://docs.docker.com/engine/reference/commandline/build/) +* [Docker run command reference](https://docs.docker.com/engine/reference/run/) +* [Dockerfile reference](https://docs.docker.com/engine/reference/builder/) diff --git a/dockerfiles/ubuntu/msf4j/README.md b/dockerfiles/ubuntu/msf4j/README.md new file mode 100644 index 00000000..368bed48 --- /dev/null +++ b/dockerfiles/ubuntu/msf4j/README.md @@ -0,0 +1,82 @@ +# Dockerfile for MSF4J profile of WSO2 Enterprise Integrator # +This section defines the step-by-step instructions to build an [Ubuntu](https://hub.docker.com/_/ubuntu/) Linux based Docker image +MSF4J profile for WSO2 Enterprise Integrator 6.4.0. + +## Prerequisites + +* [Docker](https://www.docker.com/get-docker) v17.09.0 or above + + +## How to build an image and run +##### 1. Checkout this repository into your local machine using the following Git command. +``` +git clone https://github.com/wso2/docker-ei.git +``` + +>The local copy of the `dockerfiles/ubuntu/msf4j` directory will be referred to as `MSF4J_DOCKERFILE_HOME` from this point onwards. + +##### 2. Add MSF4J profile distribution and MySQL connector to `/files`. + +- Download [WSO2 Enterprise Integrator 6.4.0 distribution](https://wso2.com/integration/) distribution. +Extract the product distribution and execute the `/bin/profile-creator.sh` to generate the MSF4J +profile distribution. + +``` +.//bin/profile-creator.sh +``` + +Extract the generated profile distribution to `/files`. + +- Download [MySQL Connector/J](https://downloads.mysql.com/archives/c-j) +and copy that to `/files`. +- Once all of these are in place, it should look as follows: + + ```bash + /files/wso2ei-6.4.0/ + /files/mysql-connector-java--bin.jar + ``` + +>Please refer to [WSO2 Update Manager documentation]( https://docs.wso2.com/display/WUM300/WSO2+Update+Manager) +in order to obtain latest bug fixes and updates for the product. + +##### 3. Build the Docker image. +- Navigate to `` directory.
+ Execute `docker build` command as shown below. + + `docker build -t wso2ei-msf4j:6.4.0 .` + +##### 4. Running the Docker image. +- `docker run -p 9090:9090 wso2ei-msf4j:6.4.0` + +>In here, refers to hostname or IP of the host machine on top of which containers are spawned. + + +## How to update configurations +Configurations would lie on the Docker host machine and they can be volume mounted to the container.
+As an example, steps required to change the port offset using `carbon.xml` is as follows. + +##### 1. Stop the Micro Integrator profile container if it's already running. +In MSF4J profile product distribution, `carbon.yml` configuration file can be found at `/wso2/msf4j/conf`. +Copy the file to some suitable location of the host machine, referred to as `/carbon.yml` and change +the offset value under ports to 1. + +##### 2. Grant read permission to `other` users for `/carbon.yml` +``` +chmod o+r /carbon.yml +``` + +##### 3. Run the image by mounting the file to container as follows. +``` +docker run \ +-p 9090:9090 \ +--volume /carbon.yml:/carbon.yml \ +wso2ei-msf4j:6.4.0 +``` + +>In here, refers to /home/wso2carbon/wso2ei-6.4.0/wso2/msf4j/conf folder of the container. + + +## Docker command usage references + +* [Docker build command reference](https://docs.docker.com/engine/reference/commandline/build/) +* [Docker run command reference](https://docs.docker.com/engine/reference/run/) +* [Dockerfile reference](https://docs.docker.com/engine/reference/builder/)