diff --git a/dockerfiles/alpine/apim/Dockerfile b/dockerfiles/alpine/apim/Dockerfile index 7f09e058..20d2178f 100755 --- a/dockerfiles/alpine/apim/Dockerfile +++ b/dockerfiles/alpine/apim/Dockerfile @@ -61,7 +61,7 @@ RUN echo Verifying install ... \ && echo Complete. LABEL maintainer="WSO2 Docker Maintainers " \ - 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 @@ -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} diff --git a/dockerfiles/alpine/apim/README.md b/dockerfiles/alpine/apim/README.md index b489f119..533a4488 100755 --- a/dockerfiles/alpine/apim/README.md +++ b/dockerfiles/alpine/apim/README.md @@ -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 @@ -9,7 +9,7 @@ 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 @@ -17,22 +17,35 @@ 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 `` directory.
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://:9443/carbon` @@ -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.
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
+In WSO2 API Manager version 4.1.0 product distribution, `deployment.toml` configuration file
can be found at `/repository/conf`. Copy the file to some suitable location of the host machine,
referred to as `/deployment.toml` and change the offset value (`[server]->offset`) to 1. -##### 2. Grant read permission to `other` users for `/deployment.toml`. +#### 2. Grant read permission to `other` users for `/deployment.toml`. ``` chmod o+r /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 /deployment.toml:/deployment.toml \ -wso2am:4.0.0-alpine +wso2am:4.1.0-alpine +``` + +> In here, 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, 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/) diff --git a/dockerfiles/centos/apim/Dockerfile b/dockerfiles/centos/apim/Dockerfile index 67c942fd..cd79b8e0 100755 --- a/dockerfiles/centos/apim/Dockerfile +++ b/dockerfiles/centos/apim/Dockerfile @@ -65,7 +65,7 @@ RUN echo Verifying install ... \ && echo Complete. LABEL maintainer="WSO2 Docker Maintainers " \ - 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 @@ -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} diff --git a/dockerfiles/centos/apim/README.md b/dockerfiles/centos/apim/README.md index bb99d1d6..734c2350 100755 --- a/dockerfiles/centos/apim/README.md +++ b/dockerfiles/centos/apim/README.md @@ -10,7 +10,7 @@ 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 @@ -18,22 +18,27 @@ 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 `` directory.
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://:9443/carbon` @@ -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.
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
can be found at `/repository/conf`. Copy the file to some suitable location of the host machine,
referred to as `/deployment.toml` and change the offset value (`[server]->offset`) to 1. -##### 2. Grant read permission to `other` users for `/deployment.toml`. +#### 2. Grant read permission to `other` users for `/deployment.toml`. ``` chmod o+r /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 /deployment.toml:/deployment.toml \ wso2am:4.1.0-centos ``` > In here, 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 /wso2am:4.1.0-centos-multiarch --push . +``` + +> - Here 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 /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/) diff --git a/dockerfiles/jdk8/alpine/apim/Dockerfile b/dockerfiles/jdk8/alpine/apim/Dockerfile index 063037ae..e9c4f4ec 100755 --- a/dockerfiles/jdk8/alpine/apim/Dockerfile +++ b/dockerfiles/jdk8/alpine/apim/Dockerfile @@ -90,7 +90,7 @@ RUN echo Verifying install ... \ && echo Complete. LABEL maintainer="WSO2 Docker Maintainers " \ - 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 @@ -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} diff --git a/dockerfiles/jdk8/alpine/apim/README.md b/dockerfiles/jdk8/alpine/apim/README.md index 0f74f511..267c6072 100755 --- a/dockerfiles/jdk8/alpine/apim/README.md +++ b/dockerfiles/jdk8/alpine/apim/README.md @@ -9,7 +9,7 @@ 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 @@ -17,22 +17,32 @@ 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 `` directory.
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://:9443/carbon` @@ -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.
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
can be found at `/repository/conf`. Copy the file to some suitable location of the host machine,
referred to as `/deployment.toml` and change the offset value (`[server]->offset`) to 1. -##### 2. Grant read permission to `other` users for `/deployment.toml`. +#### 2. Grant read permission to `other` users for `/deployment.toml`. ``` chmod o+r /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 /deployment.toml:/deployment.toml \ wso2am:4.1.0-alpine-jdk8 ``` @@ -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/) \ No newline at end of file diff --git a/dockerfiles/jdk8/centos/apim/Dockerfile b/dockerfiles/jdk8/centos/apim/Dockerfile index b6808256..c091c8bf 100755 --- a/dockerfiles/jdk8/centos/apim/Dockerfile +++ b/dockerfiles/jdk8/centos/apim/Dockerfile @@ -65,7 +65,7 @@ RUN echo Verifying install ... \ && echo Complete. LABEL maintainer="WSO2 Docker Maintainers " \ - 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 @@ -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} diff --git a/dockerfiles/jdk8/centos/apim/README.md b/dockerfiles/jdk8/centos/apim/README.md index 2648ce9f..cfb73a0e 100755 --- a/dockerfiles/jdk8/centos/apim/README.md +++ b/dockerfiles/jdk8/centos/apim/README.md @@ -10,7 +10,7 @@ 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 @@ -18,22 +18,26 @@ 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 `` directory.
Execute `docker build` command as shown below. - + `docker build -t wso2am:4.1.0-centos-jdk8 .` +``` +docker build -t wso2am:4.1.0-centos-jdk8 . +``` > 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-jdk8` +``` +docker run -it -p 9443:9443 -p 8243:8243 wso2am:4.1.0-centos-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://:9443/carbon` @@ -45,31 +49,73 @@ 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.
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
can be found at `/repository/conf`. Copy the file to some suitable location of the host machine,
referred to as `/deployment.toml` and change the offset value (`[server]->offset`) to 1. -##### 2. Grant read permission to `other` users for `/deployment.toml`. +#### 2. Grant read permission to `other` users for `/deployment.toml`. ``` chmod o+r /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 /deployment.toml:/deployment.toml \ wso2am:4.1.0-centos-jdk8 ``` > In here, refers to /home/wso2carbon/wso2am-4.1.0/repository/conf folder of the container. +## How to build a Docker image with multi architecture support + +The above wso2am:4.1.0-centos-jdk8 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-centos-jdk8 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 /wso2am:4.1.0-centos-jdk8-multiarch --push . +``` + +> - Here 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 /wso2am:4.1.0-centos-jdk8-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/) diff --git a/dockerfiles/jdk8/ubuntu/apim/Dockerfile b/dockerfiles/jdk8/ubuntu/apim/Dockerfile index bac40ab2..fb779504 100755 --- a/dockerfiles/jdk8/ubuntu/apim/Dockerfile +++ b/dockerfiles/jdk8/ubuntu/apim/Dockerfile @@ -68,7 +68,7 @@ RUN echo Verifying install ... \ && echo Complete. LABEL maintainer="WSO2 Docker Maintainers " \ - 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 @@ -79,7 +79,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} diff --git a/dockerfiles/jdk8/ubuntu/apim/README.md b/dockerfiles/jdk8/ubuntu/apim/README.md index 804cd086..e2636f0c 100755 --- a/dockerfiles/jdk8/ubuntu/apim/README.md +++ b/dockerfiles/jdk8/ubuntu/apim/README.md @@ -9,7 +9,7 @@ This section defines the step-by-step instructions to build an [Ubuntu](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 @@ -17,22 +17,26 @@ git clone https://github.com/wso2/docker-apim.git > The local copy of the `dockerfiles/ubuntu/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 `` directory.
Execute `docker build` command as shown below. - + `docker build -t wso2am:4.1.0-jdk8 .` +``` +docker build -t wso2am:4.1.0-jdk8 . +``` > 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-jdk8` +``` +docker run -it -p 9443:9443 -p 8242:8243 wso2am:4.1.0-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://:9443/carbon` @@ -44,31 +48,73 @@ 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.
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
can be found at `/repository/conf`. Copy the file to some suitable location of the host machine,
referred to as `/deployment.toml` and change the offset value (`[server]->offset`) to 1. -##### 2. Grant read permission to `other` users for `/deployment.toml`. +#### 2. Grant read permission to `other` users for `/deployment.toml`. ``` chmod o+r /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 /deployment.toml:/deployment.toml \ wso2am:4.1.0-jdk8 ``` > In here, refers to /home/wso2carbon/wso2am-4.1.0/repository/conf folder of the container. +## How to build a Docker image with multi architecture support + +The above wso2am:4.1.0-jdk8 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-jdk8 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 /wso2am:4.1.0-jdk8-multiarch --push . +``` + +> - Here 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 /wso2am:4.1.0-jdk8-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/) diff --git a/dockerfiles/ubuntu/apim/Dockerfile b/dockerfiles/ubuntu/apim/Dockerfile index ace26550..9f3a67a8 100755 --- a/dockerfiles/ubuntu/apim/Dockerfile +++ b/dockerfiles/ubuntu/apim/Dockerfile @@ -76,7 +76,7 @@ RUN echo Verifying install ... \ && echo Complete. LABEL maintainer="WSO2 Docker Maintainers " \ - 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 @@ -87,7 +87,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} diff --git a/dockerfiles/ubuntu/apim/README.md b/dockerfiles/ubuntu/apim/README.md index 7f1118bc..7b33b78f 100755 --- a/dockerfiles/ubuntu/apim/README.md +++ b/dockerfiles/ubuntu/apim/README.md @@ -9,7 +9,7 @@ This section defines the step-by-step instructions to build an [Ubuntu](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 @@ -17,22 +17,26 @@ git clone https://github.com/wso2/docker-apim.git > The local copy of the `dockerfiles/ubuntu/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 `` directory.
Execute `docker build` command as shown below. - + `docker build -t wso2am:4.1.0` +``` +docker build -t wso2am:4.1.0 +``` > 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` +``` +docker run -it -p 9443:9443 -p 8243:8243 wso2am:4.1.0 +``` -> 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://:9443/carbon` @@ -44,31 +48,87 @@ 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.
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
can be found at `/repository/conf`. Copy the file to some suitable location of the host machine,
referred to as `/deployment.toml` and change the offset value (`[server]->offset`) to 1. -##### 2. Grant read permission to `other` users for `/deployment.toml`. +#### 2. Grant read permission to `other` users for `/deployment.toml`. ``` chmod o+r /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 /deployment.toml:/deployment.toml \ wso2am:4.1.0 ``` > In here, refers to /home/wso2carbon/wso2am-4.1.0/repository/conf folder of the container. +## 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 /wso2am:4.1.0-multiarch --push . +``` + +> - Here 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 /wso2am:4.1.0-multiarch +``` +> Docker will pull the suitable image for the architecture and run + +## Running official wso2am images +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:latest +``` + +- To run on native Apple Silicon ( arm64 ) +``` +docker run -it -p 9443:9443 -p 8243:8243 wso2/wso2am:4.1.0-multiarch +``` + + ## 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/)