Docker 32-bit JRE with WebSphere Liberty

Dockerfile

FROM i686/ubuntu

RUN apt-get update \
    && apt-get install -y --no-install-recommends wget unzip ca-certificates \
    && rm -rf /var/lib/apt/lists/*

ENV JAVA_VERSION 1.8.0_sr4fp6

RUN BASE_URL="https://public.dhe.ibm.com/ibmdl/export/pub/systems/cloud/runtimes/java/meta/" \
    && YML_FILE="sdk/linux/i386/index.yml" \
    && wget -q -U UA_IBM_JAVA_Docker -O /tmp/index.yml $BASE_URL/$YML_FILE \
    && JAVA_URL=$(cat /tmp/index.yml | sed -n '/'$JAVA_VERSION'/{n;p}' | sed -n 's/\s*uri:\s//p' | tr -d '\r') \
    && wget -q -U UA_IBM_JAVA_Docker -O /tmp/ibm-java.bin $JAVA_URL \
    && echo "INSTALLER_UI=silent" > /tmp/response.properties \
    && echo "USER_INSTALL_DIR=/opt/ibm/java" >> /tmp/response.properties \
    && echo "LICENSE_ACCEPTED=TRUE" >> /tmp/response.properties \
    && mkdir -p /opt/ibm \
    && chmod +x /tmp/ibm-java.bin \
    && /tmp/ibm-java.bin -i silent -f /tmp/response.properties \
    && rm -f /tmp/response.properties \
    && rm -f /tmp/index.yml \
    && rm -f /tmp/ibm-java.bin

ENV JAVA_HOME=/opt/ibm/java/jre \
    PATH=/wlp/bin:/opt/ibm/java/bin:$PATH

ENV LIBERTY_VERSION 17.0.0_01
ARG LIBERTY_URL
ARG DOWNLOAD_OPTIONS=""
RUN LIBERTY_URL=${LIBERTY_URL:-$(wget -q -O - https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/downloads/wlp/index.yml  | grep $LIBERTY_VERSION -A 6 | sed -n 's/\s*kernel:\s//p' | tr -d '\r' )}  \
    && wget -q $DOWNLOAD_OPTIONS $LIBERTY_URL -U UA-IBM-WebSphere-Liberty-Docker -O /tmp/wlp.zip \
    && unzip -q /tmp/wlp.zip \
    && rm /tmp/wlp.zip

EXPOSE 9080 9443

# Create default server
RUN server create

COPY jvm.options /wlp/usr/servers/defaultServer/

CMD ["/wlp/bin/server", "run"]

This also requires a `jvm.options` that will be copied to the in your server directory to limit the heap size to 1GB (that would allow you to have a test and production environment and not exceed the 2GB limit so you do not have to pay a cent for your installation).

-Xmx1024m

In a nutshell, I started from a 32-bit Ubuntu then got the 32-IBM JDK. Installed and created a server that is more or less ready to use.

You can use `docker exec [container] ps aux` to get a relative idea on the memory utilization. Though `jstat` would be preferred, it is not included in the JRE.