-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #103 from chirangaalwis/docker-ei-v6.4.x-refinements
Optimize WSO2 Enterprise Integrator product Docker resources and use AdoptOpenJDK 8
- Loading branch information
Showing
82 changed files
with
2,585 additions
and
754 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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:<br> | ||
|
||
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 `<ANALYTICS_DOCKERFILE_HOME>/base/files`. | ||
|
||
- Download [WSO2 Enterprise Integrator 6.4.0 distribution](https://wso2.com/integration/) distribution. | ||
Extract the product distribution and execute the `<EI_HOME>/bin/profile-creator.sh` to generate the Micro Integrator | ||
profile distribution. | ||
|
||
``` | ||
./<EI_HOME>/bin/profile-creator.sh | ||
``` | ||
|
||
Extract the generated profile distribution to `<ANALYTICS_DOCKERFILE_HOME>/base/files`. | ||
|
||
- Download [MySQL Connector/J](https://downloads.mysql.com/archives/c-j) | ||
and copy that to `<ANALYTICS_DOCKERFILE_HOME>/base/files`. | ||
- Once all of these are in place, it should look as follows: | ||
|
||
```bash | ||
<ANALYTICS_DOCKERFILE_HOME>/base/files/wso2ei-6.4.0/ | ||
<ANALYTICS_DOCKERFILE_HOME>/base/files/mysql-connector-java-<version>-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 `<ANALYTICS_DOCKERFILE_HOME>/base` directory. <br> | ||
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 `<ANALYTICS_DOCKERFILE_HOME>/dashboard` directory. <br> | ||
Execute `docker build` command as shown below. | ||
+ `docker build -t wso2ei-analytics-dashboard:6.4.0-alpine .` | ||
- For worker, navigate to `<ANALYTICS_DOCKERFILE_HOME>/worker` directory. <br> | ||
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:<br> | ||
`https://<DOCKER_HOST>:9643/business-rules` | ||
+ Portal:<br> | ||
`https://<DOCKER_HOST>:9643/portal` | ||
+ Monitoring:<br> | ||
`https://<DOCKER_HOST>:9643/monitoring` | ||
|
||
>In here, <DOCKER_HOST> 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. <br> | ||
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 <br> | ||
can be found at `<DISTRIBUTION_HOME>/wso2/analytics/conf/worker`. Copy the file to some suitable location of the host machine, <br> | ||
referred to as `<SOURCE_CONFIGS>/deployment.yaml` and change the offset value under ports to 2. | ||
|
||
##### 2. Grant read permission to `other` users for `<SOURCE_CONFIGS>/deployment.yaml` | ||
``` | ||
chmod o+r <SOURCE_CONFIGS>/deployment.yaml | ||
``` | ||
|
||
##### 3. Run the image by mounting the file to container as follows. | ||
``` | ||
docker run | ||
-p 9444:9444 | ||
--volume <SOURCE_CONFIGS>/deployment.yaml:<TARGET_CONFIGS>/deployment.yaml | ||
wso2ei-analytics-worker:6.4.0-alpine | ||
``` | ||
|
||
>In here, <TARGET_CONFIGS> 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/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.