Skip to content

Commit

Permalink
Merge pull request #458 from IsuruMaduranga/4.1.x-update
Browse files Browse the repository at this point in the history
Update Docker artifacts for 4.1.0 GA release
  • Loading branch information
RakhithaRR committed Apr 5, 2022
2 parents 038beae + b1acf7a commit 1f9313b
Show file tree
Hide file tree
Showing 12 changed files with 321 additions and 76 deletions.
4 changes: 2 additions & 2 deletions dockerfiles/alpine/apim/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ RUN echo Verifying install ... \
&& echo Complete.

LABEL maintainer="WSO2 Docker Maintainers <dev@wso2.org>" \
com.wso2.docker.source="https://github.com/wso2/docker-apim/releases/tag/v4.0.0.4"
com.wso2.docker.source="https://github.com/wso2/docker-apim/releases/tag/v4.1.0.1"

# set Docker image build arguments
# build arguments for user/group configurations
Expand All @@ -72,7 +72,7 @@ ARG USER_GROUP_ID=802
ARG USER_HOME=/home/${USER}
# build arguments for WSO2 product installation
ARG WSO2_SERVER_NAME=wso2am
ARG WSO2_SERVER_VERSION=4.0.0
ARG WSO2_SERVER_VERSION=4.1.0
ARG WSO2_SERVER_REPOSITORY=product-apim
ARG WSO2_SERVER=${WSO2_SERVER_NAME}-${WSO2_SERVER_VERSION}
ARG WSO2_SERVER_HOME=${USER_HOME}/${WSO2_SERVER}
Expand Down
53 changes: 39 additions & 14 deletions dockerfiles/alpine/apim/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Dockerfile for WSO2 API Manager #

This section defines the step-by-step instructions to build an [Alpine](https://hub.docker.com/_/alpine/) Linux based Docker image for WSO2 API Manager 4.0.0.
This section defines the step-by-step instructions to build an [Alpine](https://hub.docker.com/_/alpine/) Linux based Docker image for WSO2 API Manager 4.1.0.

## Prerequisites

Expand All @@ -9,30 +9,43 @@ This section defines the step-by-step instructions to build an [Alpine](https://

## How to build an image and run

##### 1. Checkout this repository into your local machine using the following Git client command.
#### 1. Checkout this repository into your local machine using the following Git client command.

```
git clone https://github.com/wso2/docker-apim.git
```

> The local copy of the `dockerfiles/alpine/apim` directory will be referred to as `AM_DOCKERFILE_HOME` from this point onwards.
##### 2. Build the Docker image.
#### 2. Build the Docker image.



- Navigate to `<AM_DOCKERFILE_HOME>` directory. <br>
Execute `docker build` command as shown below.
+ `docker build -t wso2am:4.0.0-alpine .`

```
docker build -t wso2am:4.1.0-alpine .
```

> By default, the Docker image will prepackage the General Availability (GA) release version of the relevant WSO2 product.
##### 3. Running the Docker image.
> Note:- wso2am:4.1.0-alpine image can only be built on amd64(x86_64). It is not supported to be built or run natively on Apple silicon. But it is possible to build an amd64 image using [Docker buildx](https://docs.docker.com/desktop/multi-arch/) and then run via emulation on rosetta. Use following command.
```
docker buildx build --platform linux/amd64 -t wso2am:4.1.0-alpine .
```

#### 3. Running the Docker image.

- `docker run -it -p 9443:9443 wso2am:4.0.0-alpine`
```
docker run -it -p 9443:9443 -p 8243:8243 wso2am:4.1.0-alpine
```

> Here, only port 9443 (HTTPS servlet transport) has been mapped to a Docker host port.
> Here, only port 9443 (HTTPS servlet transport) and port 8243 (Passthrough or NIO HTTPS transport) have been mapped to Docker host ports.
You may map other container service ports, which have been exposed to Docker host ports, as desired.

##### 4. Accessing management console.
#### 4. Accessing management console.

- To access the management console, use the docker host IP and port 9443.
+ `https://<DOCKER_HOST>:9443/carbon`
Expand All @@ -44,31 +57,43 @@ You may map other container service ports, which have been exposed to Docker hos
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.toml` is as follows:

##### 1. Stop the API Manager container if it's already running.
#### 1. Stop the API Manager container if it's already running.

In WSO2 API Manager version 4.0.0 product distribution, `deployment.toml` configuration file <br>
In WSO2 API Manager version 4.1.0 product distribution, `deployment.toml` configuration file <br>
can be found at `<DISTRIBUTION_HOME>/repository/conf`. Copy the file to some suitable location of the host machine, <br>
referred to as `<SOURCE_CONFIGS>/deployment.toml` and change the offset value (`[server]->offset`) to 1.

##### 2. Grant read permission to `other` users for `<SOURCE_CONFIGS>/deployment.toml`.
#### 2. Grant read permission to `other` users for `<SOURCE_CONFIGS>/deployment.toml`.

```
chmod o+r <SOURCE_CONFIGS>/deployment.toml
```

##### 3. Run the image by mounting the file to container as follows:
#### 3. Run the image by mounting the file to container as follows:

```
docker run \
-p 9444:9444 \
-p 8244:8244 \
--volume <SOURCE_CONFIGS>/deployment.toml:<TARGET_CONFIGS>/deployment.toml \
wso2am:4.0.0-alpine
wso2am:4.1.0-alpine
```

> In here, <TARGET_CONFIGS> refers to /home/wso2carbon/wso2am-4.1.0/repository/conf folder of the container.
## Running official wso2am image
It is possible to use official wso2am images without building them from the scratch.

- To run on amd64
```
docker run -it -p 9443:9443 -p 8243:8243 wso2/wso2am:4.1.0-alpine
```
> This image is only supported for amd64.
> In here, <TARGET_CONFIGS> refers to /home/wso2carbon/wso2am-4.0.0/repository/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/)
* [Docker buildx reference](https://docs.docker.com/buildx/working-with-buildx/)
4 changes: 2 additions & 2 deletions dockerfiles/centos/apim/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ RUN echo Verifying install ... \
&& echo Complete.

LABEL maintainer="WSO2 Docker Maintainers <dev@wso2.org>" \
com.wso2.docker.source="https://github.com/wso2/docker-apim/releases/tag/v4.1.0.0"
com.wso2.docker.source="https://github.com/wso2/docker-apim/releases/tag/v4.1.0.1"

# set Docker image build arguments
# build arguments for user/group configurations
Expand All @@ -76,7 +76,7 @@ ARG USER_GROUP_ID=802
ARG USER_HOME=/home/${USER}
# build arguments for WSO2 product installation
ARG WSO2_SERVER_NAME=wso2am
ARG WSO2_SERVER_VERSION=4.1.0-beta
ARG WSO2_SERVER_VERSION=4.1.0
ARG WSO2_SERVER_REPOSITORY=product-apim
ARG WSO2_SERVER=${WSO2_SERVER_NAME}-${WSO2_SERVER_VERSION}
ARG WSO2_SERVER_HOME=${USER_HOME}/${WSO2_SERVER}
Expand Down
76 changes: 66 additions & 10 deletions dockerfiles/centos/apim/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,35 @@ This section defines the step-by-step instructions to build an [CentOS](https://

## How to build an image and run

##### 1. Checkout this repository into your local machine using the following Git client command.
#### 1. Checkout this repository into your local machine using the following Git client command.

```
git clone https://github.com/wso2/docker-apim.git
```

> The local copy of the `dockerfiles/centos/apim` directory will be referred to as `AM_DOCKERFILE_HOME` from this point onwards.
##### 2. Build the Docker image.
#### 2. Build the Docker image.

- Navigate to `<AM_DOCKERFILE_HOME>` directory. <br>
Execute `docker build` command as shown below.
+ `docker build -t wso2am:4.1.0-centos .`

```
docker build -t wso2am:4.1.0-centos .
```

> By default, the Docker image will prepackage the General Availability (GA) release version of the relevant WSO2 product.
##### 3. Running the Docker image.
#### 3. Running the Docker image.

- `docker run -it -p 9443:9443 wso2am:4.1.0-centos`
```
docker run -it -p 9443:9443 -p 8243:8243 wso2am:4.1.0-centos
```

> Here, only port 9443 (HTTPS servlet transport) has been mapped to a Docker host port.
> Here, only port 9443 (HTTPS servlet transport) and port 8243 (Passthrough or NIO HTTPS transport) have been mapped to Docker host ports.
You may map other container service ports, which have been exposed to Docker host ports, as desired.

##### 4. Accessing management console.
#### 4. Accessing management console.

- To access the management console, use the docker host IP and port 9443.
+ `https://<DOCKER_HOST>:9443/carbon`
Expand All @@ -45,31 +50,82 @@ You may map other container service ports, which have been exposed to Docker hos
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.toml` is as follows:

##### 1. Stop the API Manager container if it's already running.
#### 1. Stop the API Manager container if it's already running.

In WSO2 API Manager version 4.1.0 product distribution, `deployment.toml` configuration file <br>
can be found at `<DISTRIBUTION_HOME>/repository/conf`. Copy the file to some suitable location of the host machine, <br>
referred to as `<SOURCE_CONFIGS>/deployment.toml` and change the offset value (`[server]->offset`) to 1.

##### 2. Grant read permission to `other` users for `<SOURCE_CONFIGS>/deployment.toml`.
#### 2. Grant read permission to `other` users for `<SOURCE_CONFIGS>/deployment.toml`.

```
chmod o+r <SOURCE_CONFIGS>/deployment.toml
```

##### 3. Run the image by mounting the file to container as follows:
#### 3. Run the image by mounting the file to container as follows:

```
docker run \
-p 9444:9444 \
-p 8244:8244 \
--volume <SOURCE_CONFIGS>/deployment.toml:<TARGET_CONFIGS>/deployment.toml \
wso2am:4.1.0-centos
```

> In here, <TARGET_CONFIGS> refers to /home/wso2carbon/wso2am-4.1.0/repository/conf folder of the container.
## Running official Ubuntu wso2am images
It is possible to use official wso2am images without building them from the scratch.

- To run on amd64 or Apple Silicon (arm64)
```
docker run -it -p 9443:9443 -p 8243:8243 wso2/wso2am:4.1.0-centos
```
> This official image is built for amd64 thus it will not run on Apple silicon natively. But it will run on emulated docker on Rosetta.
## How to build a Docker image with multi architecture support

The above wso2am:4.1.0 image will only be supported for the CPU architecture of your current machine. Docker buildx plugin can be used to build wso2am:4.1.0 image to support any CPU architecture.

#### 1. Install [Docker Buildx](https://docs.docker.com/buildx/working-with-buildx/)

#### 2. Install [QEMU Emulators](https://github.com/tonistiigi/binfmt)
```
docker run -it --rm --privileged tonistiigi/binfmt --install all
```

#### 3. Create, switch and inspect a new builder
```
docker buildx create --name wso2ambuilder
```
```
docker buildx use wso2ambuilder
```
```
docker buildx inspect --bootstrap
```
#### 4. Build and push

```
docker buildx build --platform linux/amd64,linux/arm64 -t <DOCKER_USERNAME>/wso2am:4.1.0-centos-multiarch --push .
```

> - Here <DOCKER_USERNAME> is a valid Docker or Dockerhub username.
> - Use command "docker login" to authenticate first if it fails to push.
> - You can specify any number of platforms to support --platform flag
> - Use command "docker buildx ls" to see list of existing builders and supported platforms.
> - Please note we have only tested this for linux/amd64 and linux/arm64 platforms only
#### 5. Run
```
docker run -it -p 9443:9443 -p 8243:8243 <DOCKER_USERNAME>/wso2am:4.1.0-centos-multiarch
```
> Docker will pull the suitable image for the architecture and run
## 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/)
* [Docker multi architecture build reference](https://docs.docker.com/desktop/multi-arch/)
* [Docker buildx reference](https://docs.docker.com/buildx/working-with-buildx/)
4 changes: 2 additions & 2 deletions dockerfiles/jdk8/alpine/apim/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ RUN echo Verifying install ... \
&& echo Complete.

LABEL maintainer="WSO2 Docker Maintainers <dev@wso2.org>" \
com.wso2.docker.source="https://github.com/wso2/docker-apim/releases/tag/v4.1.0.0"
com.wso2.docker.source="https://github.com/wso2/docker-apim/releases/tag/v4.1.0.1"

# set Docker image build arguments
# build arguments for user/group configurations
Expand All @@ -101,7 +101,7 @@ ARG USER_GROUP_ID=802
ARG USER_HOME=/home/${USER}
# build arguments for WSO2 product installation
ARG WSO2_SERVER_NAME=wso2am
ARG WSO2_SERVER_VERSION=4.1.0-beta
ARG WSO2_SERVER_VERSION=4.1.0
ARG WSO2_SERVER_REPOSITORY=product-apim
ARG WSO2_SERVER=${WSO2_SERVER_NAME}-${WSO2_SERVER_VERSION}
ARG WSO2_SERVER_HOME=${USER_HOME}/${WSO2_SERVER}
Expand Down
32 changes: 22 additions & 10 deletions dockerfiles/jdk8/alpine/apim/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,40 @@ This section defines the step-by-step instructions to build an [Alpine](https://

## How to build an image and run

##### 1. Checkout this repository into your local machine using the following Git client command.
#### 1. Checkout this repository into your local machine using the following Git client command.

```
git clone https://github.com/wso2/docker-apim.git
```

> The local copy of the `dockerfiles/alpine/apim` directory will be referred to as `AM_DOCKERFILE_HOME` from this point onwards.
##### 2. Build the Docker image.
#### 2. Build the Docker image.

- Navigate to `<AM_DOCKERFILE_HOME>` directory. <br>
Execute `docker build` command as shown below.
+ `docker build -t wso2am:4.1.0-alpine-jdk8 .`
```
docker build -t wso2am:4.1.0-alpine-jdk8 .
```

> By default, the Docker image will prepackage the General Availability (GA) release version of the relevant WSO2 product.
##### 3. Running the Docker image.
> Note:- wso2am:4.1.0-alpine-jdk8 image can only be built on amd64(x86_64). It is not supported to be built or run natively on Apple silicon. But it is possible to build an amd64 image using [Docker buildx](https://docs.docker.com/desktop/multi-arch/) and then run via emulation on rosetta. Use following command.
```
docker buildx build --platform linux/amd64 -t wso2am:4.1.0-alpine-jdk8 .
```

#### 3. Running the Docker image.

- `docker run -it -p 9443:9443 wso2am:4.1.0-alpine-jdk8`
```
docker run -it -p 9443:9443 -p 8243:8243 wso2am:4.1.0-alpine-jdk8
```

> Here, only port 9443 (HTTPS servlet transport) has been mapped to a Docker host port.
> Here, only port 9443 (HTTPS servlet transport) and port 8243 (Passthrough or NIO HTTPS transport) have been mapped to Docker host ports.
You may map other container service ports, which have been exposed to Docker host ports, as desired.

##### 4. Accessing management console.
#### 4. Accessing management console.

- To access the management console, use the docker host IP and port 9443.
+ `https://<DOCKER_HOST>:9443/carbon`
Expand All @@ -44,23 +54,24 @@ You may map other container service ports, which have been exposed to Docker hos
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.toml` is as follows:

##### 1. Stop the API Manager container if it's already running.
#### 1. Stop the API Manager container if it's already running.

In WSO2 API Manager version 4.1.0 product distribution, `deployment.toml` configuration file <br>
can be found at `<DISTRIBUTION_HOME>/repository/conf`. Copy the file to some suitable location of the host machine, <br>
referred to as `<SOURCE_CONFIGS>/deployment.toml` and change the offset value (`[server]->offset`) to 1.

##### 2. Grant read permission to `other` users for `<SOURCE_CONFIGS>/deployment.toml`.
#### 2. Grant read permission to `other` users for `<SOURCE_CONFIGS>/deployment.toml`.

```
chmod o+r <SOURCE_CONFIGS>/deployment.toml
```

##### 3. Run the image by mounting the file to container as follows:
#### 3. Run the image by mounting the file to container as follows:

```
docker run \
-p 9444:9444 \
-p 8244:8244 \
--volume <SOURCE_CONFIGS>/deployment.toml:<TARGET_CONFIGS>/deployment.toml \
wso2am:4.1.0-alpine-jdk8
```
Expand All @@ -72,3 +83,4 @@ wso2am:4.1.0-alpine-jdk8
* [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/)
* [Docker buildx reference](https://docs.docker.com/buildx/working-with-buildx/)
4 changes: 2 additions & 2 deletions dockerfiles/jdk8/centos/apim/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ RUN echo Verifying install ... \
&& echo Complete.

LABEL maintainer="WSO2 Docker Maintainers <dev@wso2.org>" \
com.wso2.docker.source="https://github.com/wso2/docker-apim/releases/tag/v4.1.0.0"
com.wso2.docker.source="https://github.com/wso2/docker-apim/releases/tag/v4.1.0.1"

# set Docker image build arguments
# build arguments for user/group configurations
Expand All @@ -76,7 +76,7 @@ ARG USER_GROUP_ID=802
ARG USER_HOME=/home/${USER}
# build arguments for WSO2 product installation
ARG WSO2_SERVER_NAME=wso2am
ARG WSO2_SERVER_VERSION=4.1.0-beta
ARG WSO2_SERVER_VERSION=4.1.0
ARG WSO2_SERVER_REPOSITORY=product-apim
ARG WSO2_SERVER=${WSO2_SERVER_NAME}-${WSO2_SERVER_VERSION}
ARG WSO2_SERVER_HOME=${USER_HOME}/${WSO2_SERVER}
Expand Down
Loading

0 comments on commit 1f9313b

Please sign in to comment.