Sign inSign up

quynhbofit/wso2si

By quynhbofit

•Updated almost 3 years ago

Image
0

127

quynhbofit/wso2si repository overview

⁠Dockerfile

⁠4.1.0-alpine
# ------------------------------------------------------------------------
#
# Copyright 2019 WSO2, Inc. (http://wso2.com)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License
#
# ------------------------------------------------------------------------

# set base Docker image to Alpine Docker image
FROM alpine:3.15

ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'

# install JDK Dependencies
RUN apk add --no-cache tzdata musl-locales musl-locales-lang \
    && rm -rf /var/cache/apk/*

ENV JAVA_VERSION jdk-11.0.14+9

# install OpenJDK 11
RUN set -eux; \
    ARCH="$(apk --print-arch)"; \
    case "${ARCH}" in \
       amd64|x86_64) \
         ESUM='f94a01258a5496eda9e3de6807e6ecfe08a5ad4a2d42e4332a77f74174706f5c'; \
         BINARY_URL='https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.14%2B9/OpenJDK11U-jdk_x64_alpine-linux_hotspot_11.0.14_9.tar.gz'; \
         ;; \
       *) \
         echo "Unsupported arch: ${ARCH}"; \
         exit 1; \
         ;; \
    esac; \
          wget -O /tmp/openjdk.tar.gz ${BINARY_URL}; \
          echo "${ESUM} */tmp/openjdk.tar.gz" | sha256sum -c -; \
          mkdir -p /opt/java/openjdk; \
          tar --extract \
              --file /tmp/openjdk.tar.gz \
              --directory /opt/java/openjdk \
              --strip-components 1 \
              --no-same-owner \
          ; \
    rm -rf /tmp/openjdk.tar.gz;

ENV JAVA_HOME=/opt/java/openjdk \
    PATH="/opt/java/openjdk/bin:$PATH"

# Verify Java installation
RUN echo Verifying install ... \
    && echo javac --version && javac --version \
    && echo java --version && java --version \
    && echo Complete.

LABEL maintainer="WSO2 Docker Maintainers <[email protected]>" \
      com.wso2.docker.source="https://github.com/wso2/docker-ei/releases/tag/v4.1.0.1"

# set Docker image build arguments
# build arguments for user/group configurations
ARG USER=wso2carbon
ARG USER_ID=802
ARG USER_GROUP=wso2
ARG USER_GROUP_ID=802
ARG USER_HOME=/home/${USER}
# build arguments for WSO2 product installation
ARG WSO2_SERVER_NAME=wso2si
ARG WSO2_SERVER_VERSION=4.1.0
ARG WSO2_SERVER_REPOSITORY=streaming-integrator
#ARG WSO2_SERVER=${WSO2_SERVER_NAME}-${WSO2_SERVER_VERSION}
ARG WSO2_SERVER=${WSO2_SERVER_NAME}-${WSO2_SERVER_VERSION}
ARG WSO2_SERVER_HOME=${USER_HOME}/${WSO2_SERVER}
#ARG WSO2_SERVER_DIST_URL=https://github.com/wso2/${WSO2_SERVER_REPOSITORY}/releases/download/v${WSO2_SERVER_VERSION}/${WSO2_SERVER}.zip
#ARG WSO2_SERVER_DIST_URL=https://github.com/wso2/streaming-integrator/releases/download/v4.1.0-beta/wso2si-4.1.0-beta.zip
ARG WSO2_SERVER_DIST_URL=https://github.com/wso2/streaming-integrator/releases/download/v4.1.0-rc2/wso2si-4.1.0-rc2.zip
# build argument for MOTD
ARG MOTD='printf "\n\
 Welcome to WSO2 Docker Resources \n\
 --------------------------------- \n\
 This Docker container comprises of a WSO2 product, running with its latest GA release \n\
 which is under the Apache License, Version 2.0. \n\
 Read more about Apache License, Version 2.0 here @ http://www.apache.org/licenses/LICENSE-2.0.\n"'
ENV ENV=${USER_HOME}"/.ashrc"

# create the non-root user and group and set MOTD login message
RUN \
    addgroup -S -g ${USER_GROUP_ID} ${USER_GROUP} \
    && adduser -S -u ${USER_ID} -h ${USER_HOME} -G ${USER_GROUP} ${USER} \
    && echo ${MOTD} > "${ENV}"

# copy init script to user home
COPY --chown=wso2carbon:wso2 docker-entrypoint.sh ${USER_HOME}/
# install required packages
RUN \
    apk add --no-cache \
        netcat-openbsd
# add the WSO2 product distribution to user's home directory
RUN \
    wget -O ${WSO2_SERVER}.zip "${WSO2_SERVER_DIST_URL}" \
    && unzip -d ${USER_HOME} ${WSO2_SERVER}.zip \
    && rm -f ${WSO2_SERVER}.zip \
    && chown wso2carbon:wso2 -R ${WSO2_SERVER_HOME}

# 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}

# expose server ports
EXPOSE 9711 9611 7711 7611 9090 9443

# initiate container and start WSO2 Carbon server
ENTRYPOINT ["/home/wso2carbon/docker-entrypoint.sh"]
⁠4.2.0-ubuntu20.04-kafka
FROM ubuntu:20.04 as install_extension
RUN apt-get update && \
    apt-get install -y screen unzip wget net-tools openjdk-17-*
RUN wget https://storage.googleapis.com/gpay-packages/wso2si/wso2si-4.2.0.zip && \
    unzip wso2si-4.2.0.zip && \
    cp -ar wso2si-4.2.0/ /etc/wso2si/
RUN sed -i 's/JAVA_HOME=\/System\/Library\/Frameworks\/JavaVM.framework\/Versions\/${JAVA_VERSION}\/Home/JAVA_HOME=\/usr\/lib\/jvm\/java-17-openjdk-amd64/' /etc/wso2si/wso2/server/bin/carbon.sh && \
    sed -i 's/JAVA_HOME=\/System\/Library\/Frameworks\/JavaVM.framework\/Versions\/${JAVA_VERSION}\/Home/JAVA_HOME=\/usr\/lib\/jvm\/java-17-openjdk-amd64\/bin\/java/' /etc/wso2si/bin/server.sh && \
    sed -i 's/Darwin/Linux/' /etc/wso2si/wso2/server/bin/carbon.sh && \
    sed -i 's/Darwin/Linux/' /etc/wso2si/bin/server.sh && \
    rm -f /etc/wso2si/wso2/server/deployment/siddhi-files/TestSiddhiApp.siddhi
RUN screen -dmS wso2si sh -c /etc/wso2si/bin/server.sh && \
    while ! netstat -tuln | grep "9443"; do echo "Port does not exist. Waiting..."; sleep 3; done; sh /etc/wso2si/bin/extension-installer.sh install kafka

FROM ubuntu:20.04 as start_server
RUN apt-get update && \
    apt-get install -y openjdk-17-*
RUN rm /etc/localtime && \
    ln -s /usr/share/zoneinfo/Asia/Ho_Chi_Minh /etc/localtime
COPY --from=install_extension /etc/wso2si /etc/wso2si
EXPOSE 9443
CMD ["sh", "/etc/wso2si/bin/server.sh"]
⁠4.2.0-alpine3.18-kafka
FROM alpine:3.18.4 as install_extension
RUN apk add screen unzip tzdata openjdk17
RUN wget https://storage.googleapis.com/gpay-packages/wso2si/wso2si-4.2.0.zip && \
    unzip wso2si-4.2.0.zip && \
    cp -ar wso2si-4.2.0/ /etc/wso2si/ && \
    cp /usr/share/zoneinfo/Asia/Ho_Chi_Minh /etc/localtime
RUN sed -i 's/JAVA_HOME=\/System\/Library\/Frameworks\/JavaVM.framework\/Versions\/${JAVA_VERSION}\/Home/JAVA_HOME=\/usr\/lib\/jvm\/java-17-openjdk/' /etc/wso2si/wso2/server/bin/carbon.sh && \
    sed -i 's/JAVA_HOME=\/System\/Library\/Frameworks\/JavaVM.framework\/Versions\/${JAVA_VERSION}\/Home/JAVA_HOME=\/usr\/lib\/jvm\/java-17-openjdk\/bin\/java/' /etc/wso2si/bin/server.sh && \
    sed -i 's/Darwin/Linux/' /etc/wso2si/wso2/server/bin/carbon.sh && \
    sed -i 's/Darwin/Linux/' /etc/wso2si/bin/server.sh && \
    rm -f /etc/wso2si/wso2/server/deployment/siddhi-files/TestSiddhiApp.siddhi
RUN screen -dmS wso2si sh -c /etc/wso2si/bin/server.sh && \
    while ! netstat -tuln | grep "9443"; do echo "Port does not exist. Waiting..."; sleep 3; done; sh /etc/wso2si/bin/extension-installer.sh install kafka

FROM alpine:3.18.4 as start_server
RUN apk add tzdata openjdk17
RUN cp /usr/share/zoneinfo/Asia/Ho_Chi_Minh /etc/localtime
COPY --from=install_extension /etc/wso2si /etc/wso2si
EXPOSE 9443
CMD ["sh", "/etc/wso2si/bin/server.sh"]

Tag summary

Content type

Image

Digest

sha256:42581071a…

Size

308 MB

Last updated

almost 3 years ago

docker pull quynhbofit/wso2si:4.2.0-alpine3.18-kafka