Skip to content

Commit

Permalink
Update 6.0.x docker file (#351)
Browse files Browse the repository at this point in the history
* Add U2 wget logic
* Update centos Dockerfile
* Address comments
  • Loading branch information
VivekVinushanth authored Aug 15, 2022
1 parent a595a79 commit d0d177a
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 40 deletions.
15 changes: 8 additions & 7 deletions dockerfiles/alpine/is/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ ARG WSO2_SERVER_VERSION=6.0.0
ARG WSO2_SERVER_REPOSITORY=product-is
ARG WSO2_SERVER=${WSO2_SERVER_NAME}-${WSO2_SERVER_VERSION}
ARG WSO2_SERVER_HOME=${USER_HOME}/${WSO2_SERVER}
# hosted wso2is-6.0.0 distribution URL
ARG WSO2_SERVER_DIST_URL=""
# build arguments for external artifacts
ARG DNS_JAVA_VERSION=2.1.8
ARG K8S_MEMBERSHIP_SCHEME_VERSION=1.0.9
Expand Down Expand Up @@ -106,14 +108,9 @@ RUN \
&& apk add unzip \
&& apk add wget

## set the user and work directory
USER ${USER_ID}
WORKDIR ${USER_HOME}

COPY --chown=wso2carbon:wso2 ${WSO2_SERVER}.zip ${USER_HOME}/

RUN \
unzip -d ${USER_HOME} ${WSO2_SERVER}.zip \
wget -O ${WSO2_SERVER}.zip "${WSO2_SERVER_DIST_URL}" \
&& unzip -d ${USER_HOME} ${WSO2_SERVER}.zip \
&& chown wso2carbon:wso2 -R ${WSO2_SERVER_HOME} \
&& rm -f ${WSO2_SERVER}.zip

Expand All @@ -123,6 +120,10 @@ ADD --chown=wso2carbon:wso2 http://maven.wso2.org/nexus/content/repositories/rel
# add MySQL JDBC connector to server home as a third party library
ADD --chown=wso2carbon:wso2 https://repo1.maven.org/maven2/mysql/mysql-connector-java/${MYSQL_CONNECTOR_VERSION}/mysql-connector-java-${MYSQL_CONNECTOR_VERSION}.jar ${WSO2_SERVER_HOME}/repository/components/dropins/

# set the user and work directory
USER ${USER_ID}
WORKDIR ${USER_HOME}

# set environment variables
ENV WORKING_DIRECTORY=${USER_HOME} \
WSO2_SERVER_HOME=${WSO2_SERVER_HOME}
Expand Down
10 changes: 4 additions & 6 deletions dockerfiles/alpine/is/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,26 @@ git clone https://github.com/wso2/docker-is.git

>The local copy of the `dockerfiles/alpine/is` directory will be referred to as `IS_DOCKERFILE_HOME` from this point onwards.
##### 2. Copy the `wso2is-6.0.0.zip` to the `docker-is/dockerfiles/alpine/is` directory

##### 3. Build the Docker image.
##### 2. Build the Docker image.
- Navigate to `<IS_DOCKERFILE_HOME>` directory. <br>
Execute `docker build` command as shown below.
+ `docker build -t wso2is:6.0.0-alpine .`

> By default, the Docker image will prepackage the General Availability (GA) release version of the relevant WSO2 product.
> Configure the URL of hosted wso2is-6.0.0 distribution as WSO2_SERVER_DIST_URL.
> Tip - If you require the container to run with a different UID and GID, pass the preferred values of the UID and GID
> as values for build arguments `USER_ID` and `USER_GROUP_ID` when building the image, as shown below. Note
> that setting lower values for the UID and GID is not recommended.
+ `docker build -t wso2is:6.0.0-alpine --build-arg USER_ID=<UID> --build-arg USER_GROUP_ID=<GID> .`
##### 4. Running the Docker image.
##### 3. Running the Docker image.

- `docker run -it -p 9443:9443 wso2is:5.11.0-alpine`

>Here, only port 9443 (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 consoles.
##### 4. Accessing management consoles.

- To access the user interfaces, use the docker host IP and port 9443.
+ Management Console: `https://<DOCKER_HOST>:9443/console`
Expand Down
14 changes: 7 additions & 7 deletions dockerfiles/centos/is/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ ARG WSO2_SERVER_VERSION=6.0.0
ARG WSO2_SERVER_REPOSITORY=product-is
ARG WSO2_SERVER=${WSO2_SERVER_NAME}-${WSO2_SERVER_VERSION}
ARG WSO2_SERVER_HOME=${USER_HOME}/${WSO2_SERVER}
# hosted wso2is-6.0.0 distribution URL
ARG WSO2_SERVER_DIST_URL=""
# build arguments for external artifacts
ARG DNS_JAVA_VERSION=2.1.8
ARG K8S_MEMBERSHIP_SCHEME_VERSION=1.0.9
Expand Down Expand Up @@ -102,14 +104,9 @@ RUN \
wget \
&& rm -rf /var/cache/yum/*

## set the user and work directory
USER ${USER_ID}
WORKDIR ${USER_HOME}

COPY --chown=wso2carbon:wso2 ${WSO2_SERVER}.zip ${USER_HOME}/

RUN \
unzip -d ${USER_HOME} ${WSO2_SERVER}.zip \
wget -O ${WSO2_SERVER}.zip "${WSO2_SERVER_DIST_URL}" \
&& unzip -d ${USER_HOME} ${WSO2_SERVER}.zip \
&& chown wso2carbon:wso2 -R ${WSO2_SERVER_HOME} \
&& rm -f ${WSO2_SERVER}.zip

Expand All @@ -119,6 +116,9 @@ ADD --chown=wso2carbon:wso2 http://maven.wso2.org/nexus/content/repositories/rel
# add MySQL JDBC connector to server home as a third party library
ADD --chown=wso2carbon:wso2 https://repo1.maven.org/maven2/mysql/mysql-connector-java/${MYSQL_CONNECTOR_VERSION}/mysql-connector-java-${MYSQL_CONNECTOR_VERSION}.jar ${WSO2_SERVER_HOME}/repository/components/dropins/

# set the user and work directory
USER ${USER_ID}
WORKDIR ${USER_HOME}

# set environment variables
ENV WORKING_DIRECTORY=${USER_HOME} \
Expand Down
10 changes: 4 additions & 6 deletions dockerfiles/centos/is/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,26 @@ git clone https://github.com/wso2/docker-is.git

>The local copy of the `dockerfiles/centos/is` directory will be referred to as `IS_DOCKERFILE_HOME` from this point onwards.
##### 2. Copy the `wso2is-6.0.0.zip` to the `docker-is/dockerfiles/centos/is` directory

##### 3. Build the Docker image.
##### 2. Build the Docker image.
- Navigate to `<IS_DOCKERFILE_HOME>` directory. <br>
Execute `docker build` command as shown below.
+ `docker build -t wso2is:6.0.0-centos .`

> By default, the Docker image will prepackage the General Availability (GA) release version of the relevant WSO2 product.
> Configure the URL of hosted wso2is-6.0.0 distribution as WSO2_SERVER_DIST_URL.
> Tip - If you require the container to run with a different UID and GID, pass the preferred values of the UID and GID
> as values for build arguments `USER_ID` and `USER_GROUP_ID` when building the image, as shown below. Note
> that setting lower values for the UID and GID is not recommended.
+ `docker build -t wso2is:5.11.0-centos --build-arg USER_ID=<UID> --build-arg USER_GROUP_ID=<GID> .`
##### 4. Running the Docker image.
##### 3. Running the Docker image.

- `docker run -it -p 9443:9443 wso2is:6.0.0-centos`

>Here, only port 9443 (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 consoles.
##### 4. Accessing management consoles.

- To access the user interfaces, use the docker host IP and port 9443.
+ Management Console: `https://<DOCKER_HOST>:9443/console`
Expand Down
15 changes: 8 additions & 7 deletions dockerfiles/ubuntu/is/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ ARG USER_HOME=/home/${USER}
# build arguments for WSO2 product installation
ARG WSO2_SERVER_NAME=wso2is
ARG WSO2_SERVER_VERSION=6.0.0
# hosted wso2is-6.0.0 distribution URL
ARG WSO2_SERVER_DIST_URL=""
ARG WSO2_SERVER_REPOSITORY=product-is
ARG WSO2_SERVER=${WSO2_SERVER_NAME}-${WSO2_SERVER_VERSION}
ARG WSO2_SERVER_HOME=${USER_HOME}/${WSO2_SERVER}
Expand Down Expand Up @@ -107,14 +109,9 @@ RUN \
wget \
&& rm -rf /var/lib/apt/lists/*

## set the user and work directory
USER ${USER_ID}
WORKDIR ${USER_HOME}

COPY --chown=wso2carbon:wso2 ${WSO2_SERVER}.zip ${USER_HOME}/

RUN \
unzip -d ${USER_HOME} ${WSO2_SERVER}.zip \
wget -O ${WSO2_SERVER}.zip "${WSO2_SERVER_DIST_URL}" \
&& unzip -d ${USER_HOME} ${WSO2_SERVER}.zip \
&& chown wso2carbon:wso2 -R ${WSO2_SERVER_HOME} \
&& rm -f ${WSO2_SERVER}.zip

Expand All @@ -124,6 +121,10 @@ ADD --chown=wso2carbon:wso2 http://maven.wso2.org/nexus/content/repositories/rel
# add MySQL JDBC connector to server home as a third party library
ADD --chown=wso2carbon:wso2 https://repo1.maven.org/maven2/mysql/mysql-connector-java/${MYSQL_CONNECTOR_VERSION}/mysql-connector-java-${MYSQL_CONNECTOR_VERSION}.jar ${WSO2_SERVER_HOME}/repository/components/dropins/

# set the user and work directory
USER ${USER_ID}
WORKDIR ${USER_HOME}

# 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} \
Expand Down
11 changes: 4 additions & 7 deletions dockerfiles/ubuntu/is/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ based Docker image for WSO2 Identity Server `6.0.0`.

* [Docker](https://www.docker.com/get-docker) `v17.09.0` or above
* [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) client
* wso2is-6.0.0.zip pack

## How to build an image and run

Expand All @@ -19,29 +18,27 @@ git clone https://github.com/wso2/docker-is.git

>The local copy of the `dockerfiles/ubuntu/is` directory will be referred to as `IS_DOCKERFILE_HOME` from this point onwards.
##### 2. Copy the `wso2is-6.0.0.zip` to the `docker-is/dockerfiles/ubuntu/is` directory

##### 3. Build the Docker image.
##### 2. Build the Docker image.

- Navigate to `<IS_DOCKERFILE_HOME>` directory. <br>
Execute `docker build` command as shown below.
+ `docker build -t wso2is:6.0.0 .`

> By default, the Docker image will prepackage the General Availability (GA) release version of the relevant WSO2 product.
> Configure the URL of hosted wso2is-6.0.0 distribution as WSO2_SERVER_DIST_URL.
> Tip - If you require the container to run with a different UID and GID, pass the preferred values of the UID and GID
> as values for build arguments `USER_ID` and `USER_GROUP_ID` when building the image, as shown below. Note
> that setting lower values for the UID and GID is not recommended.
+ `docker build -t wso2is:6.0.0 --build-arg USER_ID=<UID> --build-arg USER_GROUP_ID=<GID> .`
##### 4. Running the Docker image.
##### 3. Running the Docker image.

- `docker run -it -p 9443:9443 wso2is:6.0.0`

>Here, only port 9443 (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 consoles.
##### 4. Accessing management consoles.

- To access the user interfaces, use the docker host IP and port 9443.
+ Management Console: `https://<DOCKER_HOST>:9443/console`
Expand Down

0 comments on commit d0d177a

Please sign in to comment.