├── README.md ├── .gitignore ├── .github ├── issue_template.md └── pull_request_template.md ├── dockerfiles ├── alpine │ └── mg │ │ ├── README.md │ │ └── Dockerfile └── ubuntu │ └── mg │ ├── README.md │ └── Dockerfile ├── CONTRIBUTING.md ├── CHANGELOG.md └── LICENSE /README.md: -------------------------------------------------------------------------------- 1 | # Docker resources for WSO2 API Microgateway 2 | 3 | This repository contains Docker resources for [WSO2 API Microgateway](https://github.com/wso2/product-microgateway/) v3.2.0 onwards. Following types of docker resources are available. 4 | 5 | - Ubuntu as base image 6 | - Alpine as base image 7 | 8 | For building instructions checkout [dockerfiles/README.md](/dockerfiles/README.md) -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled class file 2 | *.class 3 | 4 | # Log file 5 | *.log 6 | 7 | # BlueJ files 8 | *.ctxt 9 | 10 | # Mobile Tools for Java (J2ME) 11 | .mtj.tmp/ 12 | 13 | # Package Files # 14 | *.jar 15 | *.war 16 | *.nar 17 | *.ear 18 | *.zip 19 | *.tar.gz 20 | *.rar 21 | 22 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 23 | hs_err_pid* 24 | -------------------------------------------------------------------------------- /.github/issue_template.md: -------------------------------------------------------------------------------- 1 | ### Description 2 | 3 | 4 | ### Steps to reproduce 5 | 6 | ### Affected Product Version 7 | 8 | ### Environment details (with versions): 9 | - OS: 10 | - Docker: 11 | - Other: 12 | 13 | --- 14 | ### Optional Fields 15 | #### Related Issues: 16 | 17 | 18 | #### Suggested Labels: 19 | 20 | 21 | #### Suggested Assignees: 22 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | ### Purpose 2 | 3 | 4 | ### Issues 5 | 6 | Fixes # 7 | 8 | ### Tested environments 9 | 10 | Not Tested 11 | 12 | --- 13 | #### Maintainers: Check before merge 14 | - [ ] Assigned 'Type' label 15 | - [ ] Validated respective github issues 16 | - [ ] Assigned milestone to the github issue(s) 17 | -------------------------------------------------------------------------------- /dockerfiles/alpine/mg/README.md: -------------------------------------------------------------------------------- 1 | # Dockerfile for Micro-GW Base Image # 2 | 3 | This section defines the step-by-step instructions to build an [Alpine](https://hub.docker.com/_/alpine/) Linux based Docker image for Micro-GW base image. 4 | 5 | ## Prerequisites 6 | 7 | * [Docker](https://www.docker.com/get-docker) v17.09.0 or above 8 | 9 | ## How to build an image 10 | 11 | 1. Navigate to `/dockerfiles/alpine/mg` directory. 12 | 2. Build the Docker image using the following command. 13 | 14 | ```docker build --no-cache=true -t wso2/wso2micro-gw:3.2.10.1 .``` 15 | 16 | > By default, the Docker image will prepackage the General Availability (GA) release version of the relevant WSO2 product. 17 | 18 | ## Docker command usage references 19 | 20 | * [Docker build command reference](https://docs.docker.com/engine/reference/commandline/build/) 21 | * [Docker run command reference](https://docs.docker.com/engine/reference/run/) 22 | * [Dockerfile reference](https://docs.docker.com/engine/reference/builder/) 23 | -------------------------------------------------------------------------------- /dockerfiles/ubuntu/mg/README.md: -------------------------------------------------------------------------------- 1 | # Dockerfile for Micro-GW Base Image # 2 | 3 | This section defines the step-by-step instructions to build an [Ubuntu](https://hub.docker.com/_/ubuntu/) Linux based Docker image for Micro-GW base image. 4 | 5 | ## Prerequisites 6 | 7 | * [Docker](https://www.docker.com/get-docker) v17.09.0 or above 8 | 9 | ## How to build an image 10 | 11 | 1. Navigate to `/dockerfiles/ubuntu/mg` directory. 12 | 2. Build the Docker image using the following command. 13 | 14 | ```docker build --no-cache=true -t wso2/wso2micro-gw:3.2.10.1-ubuntu .``` 15 | 16 | > By default, the Docker image will prepackage the General Availability (GA) release version of the relevant WSO2 product. 17 | 18 | ## Docker command usage references 19 | 20 | * [Docker build command reference](https://docs.docker.com/engine/reference/commandline/build/) 21 | * [Docker run command reference](https://docs.docker.com/engine/reference/run/) 22 | * [Dockerfile reference](https://docs.docker.com/engine/reference/builder/) 23 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to docker-apim 2 | 3 | Docker resources for WSO2 API Microgateway is open source and we encourage contributions from our community. 4 | 5 | ## How you can Contribute 6 | 7 | ### Reporting an issue 8 | 9 | If you find an issue with the resources, first search through the [existing issues](https://github.com/wso2/docker-mg/issues) to find if the issue is already reported. If your issue is not already reported, fill the repository issue template properly and submit a new issue. Be kind enough to provide all the details you can provide, when submitting your issue. 10 | 11 | ### Code Contributions 12 | 13 | If you like to contribute with a bug fix or a new feature, start by posting an issue and discussing the best way to implement it. 14 | 15 | Unlike most projects, development for this repository is carried out devlopment branch of the respective product. Ex: 3.2.x. This is because the `master` branch contains the latest stable release of the project. 16 | The code in latest `x.x.x` branch is merged to the `master` branch for the release, after a final review and a round of testing. 17 | 18 | Please follow these guidelines when contributing to the code: 19 | 20 | 1. Fork the current repository. 21 | 2. Create a topic branch from the `3.2.x` branch. 22 | 3. Make commits in logical units. 23 | 4. Before you send out the pull request, sync your forked repository with a remote repository. This makes your pull request simple and clear. 24 | 25 | ```bash 26 | git clone https://github.com//docker-mg.git 27 | git remote add upstream https://github.com/wso2/docker-mg.git 28 | git fetch upstream 29 | git checkout -b upstream/ 30 | 31 | # add some work 32 | 33 | git push origin 34 | 35 | # submit pull request 36 | ``` 37 | 38 | **Thanks for contributing!** 39 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to Docker resources for WSO2 API Microgateway will be documented in this file. 4 | 5 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) 6 | 7 | ## [v3.2.10.1] - 2024-12-17 8 | 9 | ### Changed 10 | - Upgrade to API Microgateway 3.2.10 (refer to [issue](https://github.com/wso2/docker-mg/issues/59)) 11 | 12 | ## [v3.2.9.4] - 2024-08-30 13 | 14 | ### Changed 15 | - Upgrade Alpine base image to 3.19.4 and Ubuntu base image to 24.04 (refer to [issue](https://github.com/wso2/docker-mg/issues/56)) 16 | 17 | ## [v3.2.9.3] - 2024-07-29 18 | 19 | ### Changed 20 | - Upgrade JDK version to 17 (refer to [issue](https://github.com/wso2/docker-mg/issues/53)) 21 | 22 | ## [v3.2.9.2] - 2024-02-15 23 | 24 | ### Changed 25 | - Upgrade Alpine Base Image (refer to [issue](https://github.com/wso2/docker-mg/issues/48)) 26 | 27 | ## [v3.2.9.1] - 2024-01-10 28 | 29 | ### Changed 30 | - Upgrade to API Microgateway 3.2.9 (refer to [issue](https://github.com/wso2/docker-mg/issues/46)) 31 | 32 | ## [v3.2.8.2] - 2023-12-08 33 | 34 | ### Changed 35 | 36 | - Upgrade Alpine Base Image and Remove Unnecessary Packages (refer to [issue](https://github.com/wso2/docker-mg/issues/43)) 37 | 38 | ## [v3.2.8.1] - 2023-10-03 39 | 40 | ### Changed 41 | - Upgrade to API Microgateway 3.2.8 (refer to [issue](https://github.com/wso2/docker-mg/issues/38)) 42 | - Upgrade JRE to the latest version (refer to [issue](https://github.com/wso2/docker-mg/issues/39)) 43 | - Upgrade Ubuntu version to 22.04 (refer to [issue](https://github.com/wso2/docker-mg/issues/40)) 44 | 45 | ## [v3.2.7.1] - 2023-04-24 46 | 47 | ### Changed 48 | 49 | - Upgrade to API Microgateway 3.2.7 (refer to [issue](https://github.com/wso2/docker-mg/issues/35)) 50 | 51 | ## [v3.2.5.1] - 2022-08-08 52 | 53 | ### Changed 54 | 55 | - Upgrade to API Microgateway 3.2.5 (refer to [issue](https://github.com/wso2/docker-mg/issues/27)) 56 | - Upgrade Alpine Base Image and JRE to latest (refer to [issue](https://github.com/wso2/docker-mg/issues/28)) 57 | 58 | ## [v3.2.4.2] - 2022-06-13 59 | 60 | ### Changed 61 | 62 | - Upgrade to API Microgateway 3.2.4 (refer to [issue](https://github.com/wso2/docker-mg/issues/18)) 63 | 64 | ## [v3.2.3.1] - 2021-07-15 65 | 66 | ### Changed 67 | 68 | - Upgrade to API Microgateway 3.2.3 (refer to [issue](https://github.com/wso2/docker-mg/issues/14)) 69 | 70 | ## [v3.2.1.2] - 2021-04-10 71 | 72 | ### Changed 73 | 74 | - Upgrade base image packages during the build (refer to [issue](https://github.com/wso2/docker-mg/issues/9)) 75 | 76 | ## [v3.2.1.1] - 2020-10-27 77 | 78 | ### Changed 79 | 80 | - Upgrade to jdk8u265-b01 (refer to [issue](https://github.com/wso2/docker-mg/issues/4)) 81 | - Upgrade ubuntu base image to 20.04 (refer to [issue](https://github.com/wso2/docker-mg/issues/4)) 82 | - Upgrade to API Microgateway 3.2.1 (refer to [issue](https://github.com/wso2/docker-mg/issues/5)) 83 | - Remove `--no-check-certificate` from DockerFiles (refer to [issue](https://github.com/wso2/docker-mg/issues/6)) 84 | 85 | For detailed information on the tasks carried out during this release, please see the GitHub milestone 86 | [v3.2.1.1](https://github.com/wso2/docker-mg/milestone/2?closed=1). 87 | 88 | ## [v3.2.0] - 2020-10-12 89 | 90 | ### Environments 91 | 92 | - Successful evaluation using Docker Engine Community version `19.03.12` (both client and server) 93 | 94 | ### Added 95 | 96 | - Alpine and Ubuntu based Docker resources for WSO2 API Microgateway (refer to [issue](https://github.com/wso2/docker-mg/issues/2)) 97 | 98 | For detailed information on the tasks carried out during this release, please see the GitHub milestone 99 | [v3.2.0](https://github.com/wso2/docker-mg/milestone/1?closed=1). 100 | 101 | [v3.2.0]: https://github.com/wso2/docker-mg/compare/9405bc5...v3.2.0 102 | [v3.2.1.1]: https://github.com/wso2/docker-mg/compare/v3.2.0...v3.2.1.1 103 | [v3.2.1.2]: https://github.com/wso2/docker-mg/compare/v3.2.1.1...v3.2.1.2 104 | [v3.2.3.1]: https://github.com/wso2/docker-mg/compare/v3.2.1.2...v3.2.3.1 105 | [v3.2.4.2]: https://github.com/wso2/docker-mg/compare/v3.2.3.1...v3.2.4.2 106 | [v3.2.5.1]: https://github.com/wso2/docker-mg/compare/v3.2.4.2...v3.2.5.1 107 | [v3.2.7.1]: https://github.com/wso2/docker-mg/compare/v3.2.6.1...v3.2.7.1 108 | [v3.2.8.1]: https://github.com/wso2/docker-mg/compare/v3.2.7.1...v3.2.8.1 109 | [v3.2.8.2]: https://github.com/wso2/docker-mg/compare/v3.2.8.1...v3.2.8.2 110 | [v3.2.9.3]: https://github.com/wso2/docker-mg/compare/v3.2.9.2...v3.2.9.3 111 | [v3.2.9.4]: https://github.com/wso2/docker-mg/compare/v3.2.9.3...v3.2.9.4 112 | [v3.2.10.1]: https://github.com/wso2/docker-mg/compare/v3.2.9.4...v3.2.10.1 113 | -------------------------------------------------------------------------------- /dockerfiles/ubuntu/mg/Dockerfile: -------------------------------------------------------------------------------- 1 | # -------------------------------------------------------------------- 2 | # Copyright (c) 2020, WSO2 Inc. (http://wso2.com) All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # ----------------------------------------------------------------------- 16 | 17 | # set base Docker image to AdoptOpenJDK Ubuntu Docker image 18 | FROM ubuntu:24.04 19 | LABEL maintainer="WSO2 Docker Maintainers " \ 20 | com.wso2.docker.source="https://github.com/wso2/docker-mg/releases/tag/v3.2.10.1" 21 | 22 | ENV LANG=C.UTF-8 23 | 24 | # set Docker image build arguments 25 | # build arguments for user/group configurations 26 | ARG USER=ballerina 27 | ARG USER_ID=802 28 | ARG USER_GROUP=ballerina 29 | ARG USER_GROUP_ID=802 30 | ARG USER_HOME=/home/${USER} 31 | ARG JRE_BINARY_URL='https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.11%2B9/OpenJDK17U-jdk_x64_linux_hotspot_17.0.11_9.tar.gz' 32 | ARG INTERNAL_JRE=jdk8u382-b05-jre 33 | ARG JRE_HOME=/opt/java/openjdk 34 | 35 | # build arguments for WSO2 product installation 36 | ARG MGW_SERVER_NAME=wso2am-micro-gw-linux 37 | ARG MGW_SERVER_VERSION=3.2.10 38 | ARG MGW_SERVER=${MGW_SERVER_NAME}-${MGW_SERVER_VERSION} 39 | ARG MGW_RUNTIME_HOME=${USER_HOME}/wso2 40 | ARG MGW_SERVER_DIST_URL=https://github.com/wso2/product-microgateway/releases/download/v${MGW_SERVER_VERSION}/${MGW_SERVER}.zip 41 | 42 | # build argument for MOTD 43 | ARG MOTD="\n\ 44 | Welcome to WSO2 Docker Resources \n\ 45 | --------------------------------- \n\ 46 | This Docker container comprises of a WSO2 product, running with its latest GA release \n\ 47 | which is under the Apache License, Version 2.0. \n\ 48 | Read more about Apache License, Version 2.0 here @ http://www.apache.org/licenses/LICENSE-2.0.\n" 49 | 50 | # create the non-root user and group and set MOTD login message 51 | RUN \ 52 | groupadd --system -g ${USER_GROUP_ID} ${USER_GROUP} \ 53 | && useradd --system --create-home --home-dir ${USER_HOME} --no-log-init -g ${USER_GROUP_ID} -u ${USER_ID} ${USER} \ 54 | && echo '[ ! -z "${TERM}" -a -r /etc/motd ] && cat /etc/motd' >> /etc/bash.bashrc; echo "${MOTD}" > /etc/motd 55 | 56 | # install required packages 57 | RUN \ 58 | apt-get update \ 59 | && apt-get upgrade -y \ 60 | && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ 61 | tzdata \ 62 | ca-certificates \ 63 | fontconfig \ 64 | locales \ 65 | libxml2-utils \ 66 | netcat-traditional \ 67 | unzip \ 68 | wget \ 69 | && echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \ 70 | && locale-gen en_US.UTF-8 \ 71 | && apt-get clean -y \ 72 | && rm -rf /var/cache/apt/archives/ \ 73 | && rm -rf /var/lib/apt/lists/* 74 | 75 | # Prepare image with users, groups, packages and other configs. 76 | RUN \ 77 | wget -O ${MGW_SERVER}.zip "${MGW_SERVER_DIST_URL}" \ 78 | && wget -O /tmp/openjdk.tar.gz "${JRE_BINARY_URL}" \ 79 | && unzip -d ${USER_HOME} ${MGW_SERVER}.zip \ 80 | && mkdir -p /home/ballerina/conf \ 81 | && mv ${USER_HOME}/${MGW_SERVER} ${MGW_RUNTIME_HOME} \ 82 | && mv ${MGW_RUNTIME_HOME}/conf/micro-gw.conf ${USER_HOME}/conf/micro-gw.conf \ 83 | && chown ${USER}:${USER_GROUP} -R ${MGW_RUNTIME_HOME} \ 84 | && rm -rf ${MGW_SERVER}.zip \ 85 | && rm -rf ${MGW_RUNTIME_HOME}/lib/${INTERNAL_JRE} \ 86 | && rm -f "/root/.wget-hsts" \ 87 | && mkdir -p ${JRE_HOME} \ 88 | && cd ${JRE_HOME} \ 89 | && tar -xf /tmp/openjdk.tar.gz --strip-components=1 \ 90 | && rm -rf /tmp/openjdk.tar.gz 91 | 92 | # Remove unnecesary packages 93 | RUN apt-get purge -y unzip 94 | 95 | ENV BALLERINA_HOME ${MGW_RUNTIME_HOME}/runtime 96 | ENV GW_HOME ${MGW_RUNTIME_HOME} 97 | ENV PATH $GW_HOME/bin:$PATH 98 | ENV MGW_CONF_DIR=${USER_HOME}/conf 99 | ENV JAVA_OPTS="${JAVA_OPTS}" 100 | ENV JAVA_HOME=/opt/java/openjdk 101 | ENV PATH="/opt/java/openjdk/bin:$PATH" 102 | 103 | WORKDIR ${USER_HOME} 104 | 105 | USER ${USER} 106 | 107 | RUN \ 108 | touch ${USER_HOME}/gc.log \ 109 | && touch ${USER_HOME}/heapdump.hprof 110 | 111 | # expose ports 112 | EXPOSE 9090 9095 113 | 114 | CMD gateway /home/exec/${project}.jar 115 | -------------------------------------------------------------------------------- /dockerfiles/alpine/mg/Dockerfile: -------------------------------------------------------------------------------- 1 | # -------------------------------------------------------------------- 2 | # Copyright (c) 2020, WSO2 Inc. (http://wso2.com) All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # ----------------------------------------------------------------------- 16 | 17 | FROM alpine:3.19.4 18 | 19 | LABEL maintainer="WSO2 Docker Maintainers " \ 20 | com.wso2.docker.source="https://github.com/wso2/docker-mg/releases/tag/v3.2.10.1" 21 | 22 | ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' 23 | 24 | # Microgateway runtime distribution filename. 25 | ARG USER=ballerina 26 | ARG USER_ID=802 27 | ARG USER_GROUP=ballerina 28 | ARG USER_GROUP_ID=802 29 | ARG USER_HOME=/home/${USER} 30 | ARG JRE_BINARY_URL='https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.11%2B9/OpenJDK17U-jdk_x64_linux_hotspot_17.0.11_9.tar.gz' 31 | ARG INTERNAL_JRE=jdk8u382-b05-jre 32 | ARG JRE_HOME=/opt/java/openjdk 33 | 34 | # build arguments for WSO2 product installation 35 | ARG MGW_SERVER_NAME=wso2am-micro-gw-linux 36 | ARG MGW_SERVER_VERSION=3.2.10 37 | ARG MGW_SERVER=${MGW_SERVER_NAME}-${MGW_SERVER_VERSION} 38 | ARG MGW_RUNTIME_HOME=${USER_HOME}/wso2 39 | ARG MGW_SERVER_DIST_URL=https://github.com/wso2/product-microgateway/releases/download/v${MGW_SERVER_VERSION}/${MGW_SERVER}.zip 40 | 41 | # build argument for MOTD 42 | ARG MOTD="\n\ 43 | Welcome to WSO2 Docker Resources \n\ 44 | --------------------------------- \n\ 45 | This Docker container comprises of a WSO2 product, running with its latest GA release \n\ 46 | which is under the Apache License, Version 2.0. \n\ 47 | Read more about Apache License, Version 2.0 here @ http://www.apache.org/licenses/LICENSE-2.0.\n\n" 48 | ENV ENV=${USER_HOME}"/.ashrc" 49 | 50 | # GLIB based alpine image (alpine-glib) source is generously borrowed 51 | # From https://github.com/Docker-Hub-frolvlad/docker-alpine-glibc 52 | # Here we install GNU libc (aka glibc) and set C.UTF-8 locale as default. 53 | RUN apk add --no-cache tzdata --virtual .build-deps curl binutils zstd \ 54 | && GLIBC_VER="2.33-r0" \ 55 | && ALPINE_GLIBC_REPO="https://github.com/sgerrand/alpine-pkg-glibc/releases/download" \ 56 | && GCC_LIBS_URL="https://archive.archlinux.org/packages/g/gcc-libs/gcc-libs-10.1.0-2-x86_64.pkg.tar.zst" \ 57 | && GCC_LIBS_SHA256="f80320a03ff73e82271064e4f684cd58d7dbdb07aa06a2c4eea8e0f3c507c45c" \ 58 | && ZLIB_URL="https://archive.archlinux.org/packages/z/zlib/zlib-1%3A1.2.11-3-x86_64.pkg.tar.xz" \ 59 | && ZLIB_SHA256=17aede0b9f8baa789c5aa3f358fbf8c68a5f1228c5e6cba1a5dd34102ef4d4e5 \ 60 | && curl -LfsS https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub -o /etc/apk/keys/sgerrand.rsa.pub \ 61 | && SGERRAND_RSA_SHA256="823b54589c93b02497f1ba4dc622eaef9c813e6b0f0ebbb2f771e32adf9f4ef2" \ 62 | && echo "${SGERRAND_RSA_SHA256} */etc/apk/keys/sgerrand.rsa.pub" | sha256sum -c - \ 63 | && curl -LfsS ${ALPINE_GLIBC_REPO}/${GLIBC_VER}/glibc-${GLIBC_VER}.apk > /tmp/glibc-${GLIBC_VER}.apk \ 64 | && apk add --force-overwrite --no-cache /tmp/glibc-${GLIBC_VER}.apk \ 65 | && apk add unzip \ 66 | && curl -LfsS ${ALPINE_GLIBC_REPO}/${GLIBC_VER}/glibc-bin-${GLIBC_VER}.apk > /tmp/glibc-bin-${GLIBC_VER}.apk \ 67 | && apk add --no-cache /tmp/glibc-bin-${GLIBC_VER}.apk \ 68 | && curl -Ls ${ALPINE_GLIBC_REPO}/${GLIBC_VER}/glibc-i18n-${GLIBC_VER}.apk > /tmp/glibc-i18n-${GLIBC_VER}.apk \ 69 | && apk add --no-cache /tmp/glibc-i18n-${GLIBC_VER}.apk \ 70 | && /usr/glibc-compat/bin/localedef --force --inputfile POSIX --charmap UTF-8 "$LANG" || true \ 71 | && echo "export LANG=$LANG" > /etc/profile.d/locale.sh \ 72 | && curl -LfsS ${GCC_LIBS_URL} -o /tmp/gcc-libs.tar.zst \ 73 | && echo "${GCC_LIBS_SHA256} */tmp/gcc-libs.tar.zst" | sha256sum -c - \ 74 | && mkdir /tmp/gcc \ 75 | && zstd -d /tmp/gcc-libs.tar.zst --output-dir-flat /tmp \ 76 | && tar -xf /tmp/gcc-libs.tar -C /tmp/gcc \ 77 | && mv /tmp/gcc/usr/lib/libgcc* /tmp/gcc/usr/lib/libstdc++* /usr/glibc-compat/lib \ 78 | && strip /usr/glibc-compat/lib/libgcc_s.so.* /usr/glibc-compat/lib/libstdc++.so* \ 79 | && curl -LfsS ${ZLIB_URL} -o /tmp/libz.tar.xz \ 80 | && echo "${ZLIB_SHA256} */tmp/libz.tar.xz" | sha256sum -c - \ 81 | && mkdir /tmp/libz \ 82 | && tar -xf /tmp/libz.tar.xz -C /tmp/libz \ 83 | && mv /tmp/libz/usr/lib/libz.so* /usr/glibc-compat/lib \ 84 | && apk del --purge .build-deps glibc-i18n \ 85 | && rm -rf /tmp/*.apk /tmp/gcc /tmp/gcc-libs.tar* /tmp/libz /tmp/libz.tar.xz /var/cache/apk/* 86 | 87 | 88 | # Prepare image with users, groups, packages and other configs. 89 | # Add motd for both ash and bash 90 | RUN \ 91 | addgroup -S -g ${USER_GROUP_ID} ${USER_GROUP} \ 92 | && adduser -S -u ${USER_ID} -h ${USER_HOME} -G ${USER_GROUP} ${USER} \ 93 | && echo '[ ! -z "${TERM}" -a -r /etc/motd ] && printf "$(cat /etc/motd)"' >> ${ENV}; echo "${MOTD}" > /etc/motd \ 94 | && echo '[ ! -z "${TERM}" -a -r /etc/motd ] && printf "$(cat /etc/motd)"' >> ${USER_HOME}"/.bashrc" \ 95 | && apk add --update --no-cache bash libxml2-utils netcat-openbsd \ 96 | && wget -O /root/${MGW_SERVER}.zip "${MGW_SERVER_DIST_URL}" \ 97 | && wget -O /tmp/openjdk.tar.gz "${JRE_BINARY_URL}" \ 98 | && unzip /root/${MGW_SERVER}.zip -d /home/${USER}/ >/dev/null 2>&1 \ 99 | && mkdir -p /home/${USER}/conf \ 100 | && mv /home/${USER}/${MGW_SERVER} ${MGW_RUNTIME_HOME} \ 101 | && mv ${MGW_RUNTIME_HOME}/conf/micro-gw.conf ${USER_HOME}/conf/micro-gw.conf \ 102 | && chown ${USER}:${USER_GROUP} -R ${USER_HOME} \ 103 | && rm /root/${MGW_SERVER}.zip > /dev/null 2>&1 \ 104 | && rm -rf ${MGW_RUNTIME_HOME}/lib/${INTERNAL_JRE} \ 105 | && rm -f "/root/.wget-hsts" \ 106 | && mkdir -p ${JRE_HOME} \ 107 | && cd ${JRE_HOME} \ 108 | && tar -xf /tmp/openjdk.tar.gz --strip-components=1 \ 109 | && rm -rf /tmp/openjdk.tar.gz \ 110 | && rm -rf /var/cache/apk/* 111 | 112 | # Remove unnecesary packages 113 | RUN apk del unzip 114 | 115 | ENV BALLERINA_HOME ${MGW_RUNTIME_HOME}/runtime 116 | ENV GW_HOME ${MGW_RUNTIME_HOME} 117 | ENV PATH $GW_HOME/bin:$PATH 118 | ENV MGW_CONF_DIR=${USER_HOME}/conf 119 | ENV JAVA_OPTS="${JAVA_OPTS}" 120 | ENV JAVA_HOME=/opt/java/openjdk 121 | ENV PATH="/opt/java/openjdk/bin:$PATH" 122 | 123 | WORKDIR ${USER_HOME} 124 | 125 | USER ${USER} 126 | 127 | RUN \ 128 | touch ${USER_HOME}/gc.log \ 129 | && touch ${USER_HOME}/heapdump.hprof 130 | 131 | # expose ports 132 | EXPOSE 9090 9095 133 | 134 | CMD gateway /home/exec/${project}.jar 135 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | --------------------------------------------------------------------------------