diff --git a/ga/23.0.0.3/kernel/helpers/build/populate_scc.sh b/ga/23.0.0.3/kernel/helpers/build/populate_scc.sh index 8f65ec392..3c07a4e92 100755 --- a/ga/23.0.0.3/kernel/helpers/build/populate_scc.sh +++ b/ga/23.0.0.3/kernel/helpers/build/populate_scc.sh @@ -97,7 +97,8 @@ if [ $TRIM_SCC == yes ] then echo "Calculating SCC layer upper bound, starting with initial size $SCC_SIZE." # Populate the newly created class cache layer. - /opt/ibm/wlp/bin/server start && /opt/ibm/wlp/bin/server stop + /opt/ibm/wlp/bin/server start + /opt/ibm/wlp/bin/server stop # Find out how full it is. FULL=`( java $PRINT_LAYER_STATS || true ) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}'` echo "SCC layer is $FULL% full. Destroying layer." @@ -120,7 +121,8 @@ fi # Server start/stop to populate the /output/workarea and make subsequent server starts faster. for ((i=0; i<$ITERATIONS; i++)) do - /opt/ibm/wlp/bin/server start && /opt/ibm/wlp/bin/server stop + /opt/ibm/wlp/bin/server start + /opt/ibm/wlp/bin/server stop done # restore umask diff --git a/ga/23.0.0.6/full/Dockerfile.ubi.ibmjava8 b/ga/23.0.0.6/full/Dockerfile.ubi.ibmjava8 index 56333ba65..117065353 100644 --- a/ga/23.0.0.6/full/Dockerfile.ubi.ibmjava8 +++ b/ga/23.0.0.6/full/Dockerfile.ubi.ibmjava8 @@ -15,8 +15,6 @@ ARG PARENT_IMAGE=icr.io/appcafe/websphere-liberty:23.0.0.6-kernel-java8-ibmjava-ubi FROM $PARENT_IMAGE AS installBundle -USER root - ARG VERBOSE=false ARG REPOSITORIES_PROPERTIES="" @@ -43,7 +41,7 @@ FROM $PARENT_IMAGE ARG VERBOSE=false # Copy the runtime -COPY --from=installBundle /opt/ibm/wlp /opt/ibm/wlp +COPY --from=installBundle --chown=1001:0 /opt/ibm/wlp /opt/ibm/wlp COPY --chown=1001:0 server.xml /config/ diff --git a/ga/23.0.0.6/full/Dockerfile.ubi.openjdk11 b/ga/23.0.0.6/full/Dockerfile.ubi.openjdk11 index ccd5142e6..6327e6463 100644 --- a/ga/23.0.0.6/full/Dockerfile.ubi.openjdk11 +++ b/ga/23.0.0.6/full/Dockerfile.ubi.openjdk11 @@ -15,8 +15,6 @@ ARG PARENT_IMAGE=icr.io/appcafe/websphere-liberty:23.0.0.6-kernel-java11-openj9-ubi FROM $PARENT_IMAGE AS installBundle -USER root - ARG VERBOSE=false ARG REPOSITORIES_PROPERTIES="" @@ -43,7 +41,7 @@ FROM $PARENT_IMAGE ARG VERBOSE=false # Copy the runtime -COPY --from=installBundle /opt/ibm/wlp /opt/ibm/wlp +COPY --from=installBundle --chown=1001:0 /opt/ibm/wlp /opt/ibm/wlp COPY --chown=1001:0 server.xml /config/ diff --git a/ga/23.0.0.6/full/Dockerfile.ubi.openjdk17 b/ga/23.0.0.6/full/Dockerfile.ubi.openjdk17 index 90c63a789..8a3db2b93 100644 --- a/ga/23.0.0.6/full/Dockerfile.ubi.openjdk17 +++ b/ga/23.0.0.6/full/Dockerfile.ubi.openjdk17 @@ -15,8 +15,6 @@ ARG PARENT_IMAGE=icr.io/appcafe/websphere-liberty:23.0.0.6-kernel-java17-openj9-ubi FROM $PARENT_IMAGE AS installBundle -USER root - ARG VERBOSE=false ARG REPOSITORIES_PROPERTIES="" @@ -43,7 +41,7 @@ FROM $PARENT_IMAGE ARG VERBOSE=false # Copy the runtime -COPY --from=installBundle /opt/ibm/wlp /opt/ibm/wlp +COPY --from=installBundle --chown=1001:0 /opt/ibm/wlp /opt/ibm/wlp COPY --chown=1001:0 server.xml /config/ diff --git a/ga/23.0.0.6/full/Dockerfile.ubi.openjdk8 b/ga/23.0.0.6/full/Dockerfile.ubi.openjdk8 index 2ce3dc275..41abc3a15 100644 --- a/ga/23.0.0.6/full/Dockerfile.ubi.openjdk8 +++ b/ga/23.0.0.6/full/Dockerfile.ubi.openjdk8 @@ -15,8 +15,6 @@ ARG PARENT_IMAGE=icr.io/appcafe/websphere-liberty:23.0.0.6-kernel-java8-openj9-ubi FROM $PARENT_IMAGE AS installBundle -USER root - ARG VERBOSE=false ARG REPOSITORIES_PROPERTIES="" @@ -43,7 +41,7 @@ FROM $PARENT_IMAGE ARG VERBOSE=false # Copy the runtime -COPY --from=installBundle /opt/ibm/wlp /opt/ibm/wlp +COPY --from=installBundle --chown=1001:0 /opt/ibm/wlp /opt/ibm/wlp COPY --chown=1001:0 server.xml /config/ diff --git a/ga/23.0.0.6/full/Dockerfile.ubuntu.ibmjava8 b/ga/23.0.0.6/full/Dockerfile.ubuntu.ibmjava8 index b5583be27..9eb122917 100644 --- a/ga/23.0.0.6/full/Dockerfile.ubuntu.ibmjava8 +++ b/ga/23.0.0.6/full/Dockerfile.ubuntu.ibmjava8 @@ -12,38 +12,27 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM websphere-liberty:23.0.0.6-kernel-java8-ibmjava AS installBundle +FROM websphere-liberty:23.0.0.6-kernel-java8-ibmjava + ARG VERBOSE=false ARG REPOSITORIES_PROPERTIES="" -# If there is a local copy of the repository use that instead -COPY resources/ /tmp/ - # Install the base bundle RUN set -eux; \ if [ ! -z "$REPOSITORIES_PROPERTIES" ]; then \ mkdir /opt/ibm/wlp/etc/; \ echo "$REPOSITORIES_PROPERTIES" > /opt/ibm/wlp/etc/repositories.properties; \ - installUtility install --acceptLicense baseBundle; \ + fi; \ + installUtility install --acceptLicense baseBundle; \ + if [ ! -z "$REPOSITORIES_PROPERTIES" ]; then \ rm /opt/ibm/wlp/etc/repositories.properties; \ - elif [ -f /tmp/wlpRepo.zip ]; then \ - installUtility install --acceptLicense baseBundle --from=/tmp/wlpRepo.zip; \ - else \ - installUtility install --acceptLicense baseBundle; \ fi; \ rm -rf /output/workarea /output/logs; \ find /opt/ibm/wlp ! -perm -g=rw -print0 | xargs -r -0 chmod g+rw; -FROM websphere-liberty:23.0.0.6-kernel-java8-ibmjava -ARG VERBOSE=false - -# Copy the runtime -COPY --from=installBundle /opt/ibm/wlp /opt/ibm/wlp - COPY --chown=1001:0 server.xml /config/ # Create a new SCC layer RUN if [ "$OPENJ9_SCC" = "true" ]; then populate_scc.sh; fi \ && rm -rf /output/messaging /output/resources/security /logs/* $WLP_OUTPUT_DIR/.classCache \ && find /opt/ibm/wlp/output ! -path "*.classCache*" ! -perm -g=rwx -print0 | xargs -0 -r chmod g+rwx - diff --git a/ga/23.0.0.6/full/Dockerfile.ubuntu.openjdk11 b/ga/23.0.0.6/full/Dockerfile.ubuntu.openjdk11 index d983f604e..b1097a11b 100644 --- a/ga/23.0.0.6/full/Dockerfile.ubuntu.openjdk11 +++ b/ga/23.0.0.6/full/Dockerfile.ubuntu.openjdk11 @@ -12,37 +12,24 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM websphere-liberty:23.0.0.6-kernel-java11-openj9 AS installBundle - -USER root +FROM websphere-liberty:23.0.0.6-kernel-java11-openj9 ARG VERBOSE=false ARG REPOSITORIES_PROPERTIES="" -# If there is a local copy of the repository use that instead -COPY resources/ /tmp/ - # Install the base bundle RUN set -eux; \ if [ ! -z "$REPOSITORIES_PROPERTIES" ]; then \ mkdir /opt/ibm/wlp/etc/; \ echo "$REPOSITORIES_PROPERTIES" > /opt/ibm/wlp/etc/repositories.properties; \ - installUtility install --acceptLicense baseBundle; \ + fi; \ + installUtility install --acceptLicense baseBundle; \ + if [ ! -z "$REPOSITORIES_PROPERTIES" ]; then \ rm /opt/ibm/wlp/etc/repositories.properties; \ - elif [ -f /tmp/wlpRepo.zip ]; then \ - installUtility install --acceptLicense baseBundle --from=/tmp/wlpRepo.zip; \ - else \ - installUtility install --acceptLicense baseBundle; \ fi; \ rm -rf /output/workarea /output/logs; \ find /opt/ibm/wlp ! -perm -g=rw -print0 | xargs -r -0 chmod g+rw; -FROM websphere-liberty:23.0.0.6-kernel-java11-openj9 -ARG VERBOSE=false - -# Copy the runtime -COPY --from=installBundle /opt/ibm/wlp /opt/ibm/wlp - COPY --chown=1001:0 server.xml /config/ # Create a new SCC layer diff --git a/ga/23.0.0.6/full/Dockerfile.ubuntu.openjdk17 b/ga/23.0.0.6/full/Dockerfile.ubuntu.openjdk17 index 28fb016dd..f6a03f276 100644 --- a/ga/23.0.0.6/full/Dockerfile.ubuntu.openjdk17 +++ b/ga/23.0.0.6/full/Dockerfile.ubuntu.openjdk17 @@ -12,37 +12,24 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM websphere-liberty:23.0.0.6-kernel-java17-openj9 AS installBundle - -USER root +FROM websphere-liberty:23.0.0.6-kernel-java17-openj9 ARG VERBOSE=false ARG REPOSITORIES_PROPERTIES="" -# If there is a local copy of the repository use that instead -COPY resources/ /tmp/ - # Install the base bundle RUN set -eux; \ if [ ! -z "$REPOSITORIES_PROPERTIES" ]; then \ mkdir /opt/ibm/wlp/etc/; \ echo "$REPOSITORIES_PROPERTIES" > /opt/ibm/wlp/etc/repositories.properties; \ - installUtility install --acceptLicense baseBundle; \ + fi; \ + installUtility install --acceptLicense baseBundle; \ + if [ ! -z "$REPOSITORIES_PROPERTIES" ]; then \ rm /opt/ibm/wlp/etc/repositories.properties; \ - elif [ -f /tmp/wlpRepo.zip ]; then \ - installUtility install --acceptLicense baseBundle --from=/tmp/wlpRepo.zip; \ - else \ - installUtility install --acceptLicense baseBundle; \ fi; \ rm -rf /output/workarea /output/logs; \ find /opt/ibm/wlp ! -perm -g=rw -print0 | xargs -r -0 chmod g+rw; -FROM websphere-liberty:23.0.0.6-kernel-java17-openj9 -ARG VERBOSE=false - -# Copy the runtime -COPY --from=installBundle /opt/ibm/wlp /opt/ibm/wlp - COPY --chown=1001:0 server.xml /config/ # Create a new SCC layer diff --git a/ga/23.0.0.6/kernel/Dockerfile.ubuntu.ibmjava8 b/ga/23.0.0.6/kernel/Dockerfile.ubuntu.ibmjava8 index 0b58a7f43..1b3b88a7e 100644 --- a/ga/23.0.0.6/kernel/Dockerfile.ubuntu.ibmjava8 +++ b/ga/23.0.0.6/kernel/Dockerfile.ubuntu.ibmjava8 @@ -12,32 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM ibmjava:8-jre AS getRuntime - -USER root - -ARG VERBOSE=false - -# Install WebSphere Liberty -ARG LIBERTY_VERSION=23.0.0.6 -ARG LIBERTY_URL -ARG DOWNLOAD_OPTIONS="" - -# If there is a local copy of the image use that instead -COPY resources/ /tmp/ - -RUN apt-get update \ - && apt-get install -y --no-install-recommends unzip wget openssl \ - && rm -rf /var/lib/apt/lists/* \ - && mkdir -p /licenses/ \ - && useradd -u 1001 -r -g 0 -s /usr/sbin/nologin default \ - && LIBERTY_URL=${LIBERTY_URL:-$(wget -q -O - https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/downloads/wlp/index.yml | grep -E "^\s*kernel:.*${LIBERTY_VERSION}\.zip" | sed -n 's/\s*kernel:\s//p' | tr -d '\r' )} \ - && if [ ! -f /tmp/wlp.zip ]; then wget $DOWNLOAD_OPTIONS $LIBERTY_URL -U UA-IBM-WebSphere-Liberty-Docker -O /tmp/wlp.zip; fi \ - && unzip -q /tmp/wlp.zip -d /opt/ibm \ - && chown -R 1001:0 /opt/ibm/wlp \ - && chmod -R g+rw /opt/ibm/wlp \ - && cp -a /opt/ibm/wlp/lafiles/. /licenses/ - FROM ibmjava:8-jre USER root @@ -95,20 +69,27 @@ RUN set -eux; \ curl -LfsSo /usr/bin/dumb-init ${DUMB_INIT_URL}; \ echo "${DUMB_INIT_SHA256} */usr/bin/dumb-init" | sha256sum -c -; \ chmod +x /usr/bin/dumb-init; \ - apt-get purge --auto-remove -y wget; \ + apt-get purge --auto-remove -y curl; \ rm -rf /var/lib/apt/lists/*; -# Add default user 1001 and create wlp with right user/permissions before copying -RUN useradd -u 1001 -r -g 0 -s /usr/sbin/nologin default \ - && mkdir -p /opt/ibm/wlp \ - && chown -R 1001:0 /opt/ibm/wlp \ - && chmod -R g+rw /opt/ibm/wlp - -# Copy the runtime and licenses -COPY --from=getRuntime --chown=1001:0 /opt/ibm/wlp /opt/ibm/wlp -COPY --from=getRuntime /licenses /licenses +# Install WebSphere Liberty +ARG LIBERTY_URL +ARG DOWNLOAD_OPTIONS="" -RUN apt-get install -y --no-install-recommends openssl \ +RUN apt-get update \ + && apt-get install -y --no-install-recommends unzip wget openssl \ + && rm -rf /var/lib/apt/lists/* \ + && mkdir -p /licenses/ \ + && useradd -u 1001 -r -g 0 -s /usr/sbin/nologin default \ + && LIBERTY_URL=${LIBERTY_URL:-$(wget -q -O - https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/downloads/wlp/index.yml | grep -E "^\s*kernel:.*${LIBERTY_VERSION}\.zip" | sed -n 's/\s*kernel:\s//p' | tr -d '\r' )} \ + && wget $DOWNLOAD_OPTIONS $LIBERTY_URL -U UA-IBM-WebSphere-Liberty-Docker -O /tmp/wlp.zip \ + && unzip -q /tmp/wlp.zip -d /opt/ibm \ + && rm /tmp/wlp.zip \ + && chown -R 1001:0 /opt/ibm/wlp \ + && chmod -R g+rw /opt/ibm/wlp \ + && cp -a /opt/ibm/wlp/lafiles/. /licenses/ \ + && apt-get purge --auto-remove -y unzip \ + && apt-get purge --auto-remove -y wget \ && rm -rf /var/lib/apt/lists/* # Set Path Shortcuts diff --git a/ga/23.0.0.6/kernel/Dockerfile.ubuntu.openjdk11 b/ga/23.0.0.6/kernel/Dockerfile.ubuntu.openjdk11 index 4978eb1fa..968685e4b 100644 --- a/ga/23.0.0.6/kernel/Dockerfile.ubuntu.openjdk11 +++ b/ga/23.0.0.6/kernel/Dockerfile.ubuntu.openjdk11 @@ -12,32 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM ibm-semeru-runtimes:open-11-jre-focal AS getRuntime - -USER root - -ARG VERBOSE=false - -# Install WebSphere Liberty -ARG LIBERTY_VERSION=23.0.0.6 -ARG LIBERTY_URL -ARG DOWNLOAD_OPTIONS="" - -# If there is a local copy of the image use that instead -COPY resources/ /tmp/ - -RUN apt-get update \ - && apt-get install -y --no-install-recommends unzip wget openssl \ - && rm -rf /var/lib/apt/lists/* \ - && mkdir -p /licenses/ \ - && useradd -u 1001 -r -g 0 -s /usr/sbin/nologin default \ - && LIBERTY_URL=${LIBERTY_URL:-$(wget -q -O - https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/downloads/wlp/index.yml | grep -E "^\s*kernel:.*${LIBERTY_VERSION}\.zip" | sed -n 's/\s*kernel:\s//p' | tr -d '\r' )} \ - && if [ ! -f /tmp/wlp.zip ]; then wget $DOWNLOAD_OPTIONS $LIBERTY_URL -U UA-IBM-WebSphere-Liberty-Docker -O /tmp/wlp.zip; fi \ - && unzip -q /tmp/wlp.zip -d /opt/ibm \ - && chown -R 1001:0 /opt/ibm/wlp \ - && chmod -R g+rw /opt/ibm/wlp \ - && cp -a /opt/ibm/wlp/lafiles/. /licenses/ - FROM ibm-semeru-runtimes:open-11-jre-focal USER root @@ -94,17 +68,23 @@ RUN set -eux; \ echo "${DUMB_INIT_SHA256} */usr/bin/dumb-init" | sha256sum -c -; \ chmod +x /usr/bin/dumb-init; -# Add default user 1001 and create wlp with right user/permissions before copying -RUN useradd -u 1001 -r -g 0 -s /usr/sbin/nologin default \ - && mkdir -p /opt/ibm/wlp \ +# Install WebSphere Liberty +ARG LIBERTY_URL +ARG DOWNLOAD_OPTIONS="" +RUN apt-get update \ + && apt-get install -y --no-install-recommends unzip openssl wget \ + && rm -rf /var/lib/apt/lists/* \ + && mkdir -p /licenses/ \ + && useradd -u 1001 -r -g 0 -s /usr/sbin/nologin default \ + && LIBERTY_URL=${LIBERTY_URL:-$(wget -q -O - https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/downloads/wlp/index.yml | grep -E "^\s*kernel:.*${LIBERTY_VERSION}\.zip" | sed -n 's/\s*kernel:\s//p' | tr -d '\r' )} \ + && wget $DOWNLOAD_OPTIONS $LIBERTY_URL -U UA-IBM-WebSphere-Liberty-Docker -O /tmp/wlp.zip \ + && unzip -q /tmp/wlp.zip -d /opt/ibm \ + && rm /tmp/wlp.zip \ && chown -R 1001:0 /opt/ibm/wlp \ - && chmod -R g+rw /opt/ibm/wlp - -# Copy the runtime and licenses -COPY --from=getRuntime --chown=1001:0 /opt/ibm/wlp /opt/ibm/wlp -COPY --from=getRuntime /licenses /licenses - -RUN apt-get install -y --no-install-recommends openssl \ + && chmod -R g+rw /opt/ibm/wlp \ + && cp -a /opt/ibm/wlp/lafiles/. /licenses/ \ + && apt-get purge --auto-remove -y unzip \ + && apt-get purge --auto-remove -y wget \ && rm -rf /var/lib/apt/lists/* # Set Path Shortcuts diff --git a/ga/23.0.0.6/kernel/Dockerfile.ubuntu.openjdk17 b/ga/23.0.0.6/kernel/Dockerfile.ubuntu.openjdk17 index 7fe7d2e8c..6c75686c2 100644 --- a/ga/23.0.0.6/kernel/Dockerfile.ubuntu.openjdk17 +++ b/ga/23.0.0.6/kernel/Dockerfile.ubuntu.openjdk17 @@ -12,32 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM ibm-semeru-runtimes:open-17-jre-focal AS getRuntime - -USER root - -ARG VERBOSE=false - -# Install WebSphere Liberty -ARG LIBERTY_VERSION=23.0.0.6 -ARG LIBERTY_URL -ARG DOWNLOAD_OPTIONS="" - -# If there is a local copy of the image use that instead -COPY resources/ /tmp/ - -RUN apt-get update \ - && apt-get install -y --no-install-recommends unzip wget openssl \ - && rm -rf /var/lib/apt/lists/* \ - && mkdir -p /licenses/ \ - && useradd -u 1001 -r -g 0 -s /usr/sbin/nologin default \ - && LIBERTY_URL=${LIBERTY_URL:-$(wget -q -O - https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/downloads/wlp/index.yml | grep -E "^\s*kernel:.*${LIBERTY_VERSION}\.zip" | sed -n 's/\s*kernel:\s//p' | tr -d '\r' )} \ - && if [ ! -f /tmp/wlp.zip ]; then wget $DOWNLOAD_OPTIONS $LIBERTY_URL -U UA-IBM-WebSphere-Liberty-Docker -O /tmp/wlp.zip; fi \ - && unzip -q /tmp/wlp.zip -d /opt/ibm \ - && chown -R 1001:0 /opt/ibm/wlp \ - && chmod -R g+rw /opt/ibm/wlp \ - && cp -a /opt/ibm/wlp/lafiles/. /licenses/ - FROM ibm-semeru-runtimes:open-17-jre-focal USER root @@ -94,17 +68,23 @@ RUN set -eux; \ echo "${DUMB_INIT_SHA256} */usr/bin/dumb-init" | sha256sum -c -; \ chmod +x /usr/bin/dumb-init; -# Add default user 1001 and create wlp with right user/permissions before copying -RUN useradd -u 1001 -r -g 0 -s /usr/sbin/nologin default \ - && mkdir -p /opt/ibm/wlp \ +# Install WebSphere Liberty +ARG LIBERTY_URL +ARG DOWNLOAD_OPTIONS="" +RUN apt-get update \ + && apt-get install -y --no-install-recommends unzip openssl wget \ + && rm -rf /var/lib/apt/lists/* \ + && mkdir -p /licenses/ \ + && useradd -u 1001 -r -g 0 -s /usr/sbin/nologin default \ + && LIBERTY_URL=${LIBERTY_URL:-$(wget -q -O - https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/downloads/wlp/index.yml | grep -E "^\s*kernel:.*${LIBERTY_VERSION}\.zip" | sed -n 's/\s*kernel:\s//p' | tr -d '\r' )} \ + && wget $DOWNLOAD_OPTIONS $LIBERTY_URL -U UA-IBM-WebSphere-Liberty-Docker -O /tmp/wlp.zip \ + && unzip -q /tmp/wlp.zip -d /opt/ibm \ + && rm /tmp/wlp.zip \ && chown -R 1001:0 /opt/ibm/wlp \ - && chmod -R g+rw /opt/ibm/wlp - -# Copy the runtime and licenses -COPY --from=getRuntime --chown=1001:0 /opt/ibm/wlp /opt/ibm/wlp -COPY --from=getRuntime /licenses /licenses - -RUN apt-get install -y --no-install-recommends openssl \ + && chmod -R g+rw /opt/ibm/wlp \ + && cp -a /opt/ibm/wlp/lafiles/. /licenses/ \ + && apt-get purge --auto-remove -y unzip \ + && apt-get purge --auto-remove -y wget \ && rm -rf /var/lib/apt/lists/* # Set Path Shortcuts diff --git a/ga/23.0.0.6/kernel/helpers/build/populate_scc.sh b/ga/23.0.0.6/kernel/helpers/build/populate_scc.sh index 8f65ec392..3c07a4e92 100755 --- a/ga/23.0.0.6/kernel/helpers/build/populate_scc.sh +++ b/ga/23.0.0.6/kernel/helpers/build/populate_scc.sh @@ -97,7 +97,8 @@ if [ $TRIM_SCC == yes ] then echo "Calculating SCC layer upper bound, starting with initial size $SCC_SIZE." # Populate the newly created class cache layer. - /opt/ibm/wlp/bin/server start && /opt/ibm/wlp/bin/server stop + /opt/ibm/wlp/bin/server start + /opt/ibm/wlp/bin/server stop # Find out how full it is. FULL=`( java $PRINT_LAYER_STATS || true ) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}'` echo "SCC layer is $FULL% full. Destroying layer." @@ -120,7 +121,8 @@ fi # Server start/stop to populate the /output/workarea and make subsequent server starts faster. for ((i=0; i<$ITERATIONS; i++)) do - /opt/ibm/wlp/bin/server start && /opt/ibm/wlp/bin/server stop + /opt/ibm/wlp/bin/server start + /opt/ibm/wlp/bin/server stop done # restore umask diff --git a/ga/23.0.0.7/full/Dockerfile.ubi.ibmjava8 b/ga/23.0.0.7/full/Dockerfile.ubi.ibmjava8 index 7459b92eb..e2fac8612 100644 --- a/ga/23.0.0.7/full/Dockerfile.ubi.ibmjava8 +++ b/ga/23.0.0.7/full/Dockerfile.ubi.ibmjava8 @@ -15,8 +15,6 @@ ARG PARENT_IMAGE=icr.io/appcafe/websphere-liberty:23.0.0.7-kernel-java8-ibmjava-ubi FROM $PARENT_IMAGE AS installBundle -USER root - ARG VERBOSE=false ARG REPOSITORIES_PROPERTIES="" @@ -43,7 +41,7 @@ FROM $PARENT_IMAGE ARG VERBOSE=false # Copy the runtime -COPY --from=installBundle /opt/ibm/wlp /opt/ibm/wlp +COPY --from=installBundle --chown=1001:0 /opt/ibm/wlp /opt/ibm/wlp COPY --chown=1001:0 server.xml /config/ diff --git a/ga/23.0.0.7/full/Dockerfile.ubi.openjdk11 b/ga/23.0.0.7/full/Dockerfile.ubi.openjdk11 index 7ea47011f..5e01f9c49 100644 --- a/ga/23.0.0.7/full/Dockerfile.ubi.openjdk11 +++ b/ga/23.0.0.7/full/Dockerfile.ubi.openjdk11 @@ -15,8 +15,6 @@ ARG PARENT_IMAGE=icr.io/appcafe/websphere-liberty:23.0.0.7-kernel-java11-openj9-ubi FROM $PARENT_IMAGE AS installBundle -USER root - ARG VERBOSE=false ARG REPOSITORIES_PROPERTIES="" @@ -43,7 +41,7 @@ FROM $PARENT_IMAGE ARG VERBOSE=false # Copy the runtime -COPY --from=installBundle /opt/ibm/wlp /opt/ibm/wlp +COPY --from=installBundle --chown=1001:0 /opt/ibm/wlp /opt/ibm/wlp COPY --chown=1001:0 server.xml /config/ diff --git a/ga/23.0.0.7/full/Dockerfile.ubi.openjdk17 b/ga/23.0.0.7/full/Dockerfile.ubi.openjdk17 index d7911fdba..96a3d85a2 100644 --- a/ga/23.0.0.7/full/Dockerfile.ubi.openjdk17 +++ b/ga/23.0.0.7/full/Dockerfile.ubi.openjdk17 @@ -15,8 +15,6 @@ ARG PARENT_IMAGE=icr.io/appcafe/websphere-liberty:23.0.0.7-kernel-java17-openj9-ubi FROM $PARENT_IMAGE AS installBundle -USER root - ARG VERBOSE=false ARG REPOSITORIES_PROPERTIES="" @@ -43,7 +41,7 @@ FROM $PARENT_IMAGE ARG VERBOSE=false # Copy the runtime -COPY --from=installBundle /opt/ibm/wlp /opt/ibm/wlp +COPY --from=installBundle --chown=1001:0 /opt/ibm/wlp /opt/ibm/wlp COPY --chown=1001:0 server.xml /config/ diff --git a/ga/23.0.0.7/full/Dockerfile.ubi.openjdk8 b/ga/23.0.0.7/full/Dockerfile.ubi.openjdk8 index 420ecdb24..b1601394c 100644 --- a/ga/23.0.0.7/full/Dockerfile.ubi.openjdk8 +++ b/ga/23.0.0.7/full/Dockerfile.ubi.openjdk8 @@ -15,8 +15,6 @@ ARG PARENT_IMAGE=icr.io/appcafe/websphere-liberty:23.0.0.7-kernel-java8-openj9-ubi FROM $PARENT_IMAGE AS installBundle -USER root - ARG VERBOSE=false ARG REPOSITORIES_PROPERTIES="" @@ -43,7 +41,7 @@ FROM $PARENT_IMAGE ARG VERBOSE=false # Copy the runtime -COPY --from=installBundle /opt/ibm/wlp /opt/ibm/wlp +COPY --from=installBundle --chown=1001:0 /opt/ibm/wlp /opt/ibm/wlp COPY --chown=1001:0 server.xml /config/ diff --git a/ga/23.0.0.7/full/Dockerfile.ubuntu.ibmjava8 b/ga/23.0.0.7/full/Dockerfile.ubuntu.ibmjava8 index a200f948e..735e362e9 100644 --- a/ga/23.0.0.7/full/Dockerfile.ubuntu.ibmjava8 +++ b/ga/23.0.0.7/full/Dockerfile.ubuntu.ibmjava8 @@ -12,38 +12,27 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM websphere-liberty:23.0.0.7-kernel-java8-ibmjava AS installBundle +FROM websphere-liberty:23.0.0.7-kernel-java8-ibmjava + ARG VERBOSE=false ARG REPOSITORIES_PROPERTIES="" -# If there is a local copy of the repository use that instead -COPY resources/ /tmp/ - # Install the base bundle RUN set -eux; \ if [ ! -z "$REPOSITORIES_PROPERTIES" ]; then \ mkdir /opt/ibm/wlp/etc/; \ echo "$REPOSITORIES_PROPERTIES" > /opt/ibm/wlp/etc/repositories.properties; \ - installUtility install --acceptLicense baseBundle; \ + fi; \ + installUtility install --acceptLicense baseBundle; \ + if [ ! -z "$REPOSITORIES_PROPERTIES" ]; then \ rm /opt/ibm/wlp/etc/repositories.properties; \ - elif [ -f /tmp/wlpRepo.zip ]; then \ - installUtility install --acceptLicense baseBundle --from=/tmp/wlpRepo.zip; \ - else \ - installUtility install --acceptLicense baseBundle; \ fi; \ rm -rf /output/workarea /output/logs; \ find /opt/ibm/wlp ! -perm -g=rw -print0 | xargs -r -0 chmod g+rw; -FROM websphere-liberty:23.0.0.7-kernel-java8-ibmjava -ARG VERBOSE=false - -# Copy the runtime -COPY --from=installBundle /opt/ibm/wlp /opt/ibm/wlp - COPY --chown=1001:0 server.xml /config/ # Create a new SCC layer RUN if [ "$OPENJ9_SCC" = "true" ]; then populate_scc.sh; fi \ && rm -rf /output/messaging /output/resources/security /logs/* $WLP_OUTPUT_DIR/.classCache \ && find /opt/ibm/wlp/output ! -path "*.classCache*" ! -perm -g=rwx -print0 | xargs -0 -r chmod g+rwx - diff --git a/ga/23.0.0.7/full/Dockerfile.ubuntu.openjdk11 b/ga/23.0.0.7/full/Dockerfile.ubuntu.openjdk11 index 6695e83f2..814a5f02d 100644 --- a/ga/23.0.0.7/full/Dockerfile.ubuntu.openjdk11 +++ b/ga/23.0.0.7/full/Dockerfile.ubuntu.openjdk11 @@ -12,37 +12,24 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM websphere-liberty:23.0.0.7-kernel-java11-openj9 AS installBundle - -USER root +FROM websphere-liberty:23.0.0.7-kernel-java11-openj9 ARG VERBOSE=false ARG REPOSITORIES_PROPERTIES="" -# If there is a local copy of the repository use that instead -COPY resources/ /tmp/ - # Install the base bundle RUN set -eux; \ if [ ! -z "$REPOSITORIES_PROPERTIES" ]; then \ mkdir /opt/ibm/wlp/etc/; \ echo "$REPOSITORIES_PROPERTIES" > /opt/ibm/wlp/etc/repositories.properties; \ - installUtility install --acceptLicense baseBundle; \ + fi; \ + installUtility install --acceptLicense baseBundle; \ + if [ ! -z "$REPOSITORIES_PROPERTIES" ]; then \ rm /opt/ibm/wlp/etc/repositories.properties; \ - elif [ -f /tmp/wlpRepo.zip ]; then \ - installUtility install --acceptLicense baseBundle --from=/tmp/wlpRepo.zip; \ - else \ - installUtility install --acceptLicense baseBundle; \ fi; \ rm -rf /output/workarea /output/logs; \ find /opt/ibm/wlp ! -perm -g=rw -print0 | xargs -r -0 chmod g+rw; -FROM websphere-liberty:23.0.0.7-kernel-java11-openj9 -ARG VERBOSE=false - -# Copy the runtime -COPY --from=installBundle /opt/ibm/wlp /opt/ibm/wlp - COPY --chown=1001:0 server.xml /config/ # Create a new SCC layer diff --git a/ga/23.0.0.7/full/Dockerfile.ubuntu.openjdk17 b/ga/23.0.0.7/full/Dockerfile.ubuntu.openjdk17 index 4b5e98a02..436a388f2 100644 --- a/ga/23.0.0.7/full/Dockerfile.ubuntu.openjdk17 +++ b/ga/23.0.0.7/full/Dockerfile.ubuntu.openjdk17 @@ -12,37 +12,24 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM websphere-liberty:23.0.0.7-kernel-java17-openj9 AS installBundle - -USER root +FROM websphere-liberty:23.0.0.7-kernel-java17-openj9 ARG VERBOSE=false ARG REPOSITORIES_PROPERTIES="" -# If there is a local copy of the repository use that instead -COPY resources/ /tmp/ - # Install the base bundle RUN set -eux; \ if [ ! -z "$REPOSITORIES_PROPERTIES" ]; then \ mkdir /opt/ibm/wlp/etc/; \ echo "$REPOSITORIES_PROPERTIES" > /opt/ibm/wlp/etc/repositories.properties; \ - installUtility install --acceptLicense baseBundle; \ + fi; \ + installUtility install --acceptLicense baseBundle; \ + if [ ! -z "$REPOSITORIES_PROPERTIES" ]; then \ rm /opt/ibm/wlp/etc/repositories.properties; \ - elif [ -f /tmp/wlpRepo.zip ]; then \ - installUtility install --acceptLicense baseBundle --from=/tmp/wlpRepo.zip; \ - else \ - installUtility install --acceptLicense baseBundle; \ fi; \ rm -rf /output/workarea /output/logs; \ find /opt/ibm/wlp ! -perm -g=rw -print0 | xargs -r -0 chmod g+rw; -FROM websphere-liberty:23.0.0.7-kernel-java17-openj9 -ARG VERBOSE=false - -# Copy the runtime -COPY --from=installBundle /opt/ibm/wlp /opt/ibm/wlp - COPY --chown=1001:0 server.xml /config/ # Create a new SCC layer diff --git a/ga/23.0.0.7/kernel/Dockerfile.ubi.ibmjava8 b/ga/23.0.0.7/kernel/Dockerfile.ubi.ibmjava8 index 9d5ac1c1e..0218db758 100644 --- a/ga/23.0.0.7/kernel/Dockerfile.ubi.ibmjava8 +++ b/ga/23.0.0.7/kernel/Dockerfile.ubi.ibmjava8 @@ -135,7 +135,7 @@ RUN mkdir /logs \ && rm -rf /output \ && ln -s $WLP_OUTPUT_DIR/defaultServer /output \ && ln -s /opt/ibm/wlp/usr/servers/defaultServer /config \ - && ln -s /opt/ibm /liberty \ + && ln -s /opt/ibm/wlp /liberty \ && ln -s /opt/ibm/fixes /fixes \ && ln -s /opt/ibm/wlp/usr/shared/resources/lib.index.cache /lib.index.cache \ && mkdir -p /config/configDropins/defaults \ diff --git a/ga/23.0.0.7/kernel/Dockerfile.ubi.openjdk11 b/ga/23.0.0.7/kernel/Dockerfile.ubi.openjdk11 index cbd5df5ec..b5882d924 100644 --- a/ga/23.0.0.7/kernel/Dockerfile.ubi.openjdk11 +++ b/ga/23.0.0.7/kernel/Dockerfile.ubi.openjdk11 @@ -135,7 +135,7 @@ RUN mkdir /logs \ && rm -rf /output \ && ln -s $WLP_OUTPUT_DIR/defaultServer /output \ && ln -s /opt/ibm/wlp/usr/servers/defaultServer /config \ - && ln -s /opt/ibm /liberty \ + && ln -s /opt/ibm/wlp /liberty \ && ln -s /opt/ibm/fixes /fixes \ && ln -s /opt/ibm/wlp/usr/shared/resources/lib.index.cache /lib.index.cache \ && mkdir -p /config/configDropins/defaults \ diff --git a/ga/23.0.0.7/kernel/Dockerfile.ubi.openjdk17 b/ga/23.0.0.7/kernel/Dockerfile.ubi.openjdk17 index bdf26a8a1..569932d85 100644 --- a/ga/23.0.0.7/kernel/Dockerfile.ubi.openjdk17 +++ b/ga/23.0.0.7/kernel/Dockerfile.ubi.openjdk17 @@ -135,7 +135,7 @@ RUN mkdir /logs \ && rm -rf /output \ && ln -s $WLP_OUTPUT_DIR/defaultServer /output \ && ln -s /opt/ibm/wlp/usr/servers/defaultServer /config \ - && ln -s /opt/ibm /liberty \ + && ln -s /opt/ibm/wlp /liberty \ && ln -s /opt/ibm/fixes /fixes \ && ln -s /opt/ibm/wlp/usr/shared/resources/lib.index.cache /lib.index.cache \ && mkdir -p /config/configDropins/defaults \ diff --git a/ga/23.0.0.7/kernel/Dockerfile.ubi.openjdk8 b/ga/23.0.0.7/kernel/Dockerfile.ubi.openjdk8 index 2484c6586..90927869d 100644 --- a/ga/23.0.0.7/kernel/Dockerfile.ubi.openjdk8 +++ b/ga/23.0.0.7/kernel/Dockerfile.ubi.openjdk8 @@ -135,7 +135,7 @@ RUN mkdir /logs \ && rm -rf /output \ && ln -s $WLP_OUTPUT_DIR/defaultServer /output \ && ln -s /opt/ibm/wlp/usr/servers/defaultServer /config \ - && ln -s /opt/ibm /liberty \ + && ln -s /opt/ibm/wlp /liberty \ && ln -s /opt/ibm/fixes /fixes \ && ln -s /opt/ibm/wlp/usr/shared/resources/lib.index.cache /lib.index.cache \ && mkdir -p /config/configDropins/defaults \ diff --git a/ga/23.0.0.7/kernel/Dockerfile.ubuntu.ibmjava8 b/ga/23.0.0.7/kernel/Dockerfile.ubuntu.ibmjava8 index 796d40ac0..0342ad8bb 100644 --- a/ga/23.0.0.7/kernel/Dockerfile.ubuntu.ibmjava8 +++ b/ga/23.0.0.7/kernel/Dockerfile.ubuntu.ibmjava8 @@ -12,32 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM ibmjava:8-jre AS getRuntime - -USER root - -ARG VERBOSE=false - -# Install WebSphere Liberty -ARG LIBERTY_VERSION=23.0.0.7 -ARG LIBERTY_URL -ARG DOWNLOAD_OPTIONS="" - -# If there is a local copy of the image use that instead -COPY resources/ /tmp/ - -RUN apt-get update \ - && apt-get install -y --no-install-recommends unzip wget openssl \ - && rm -rf /var/lib/apt/lists/* \ - && mkdir -p /licenses/ \ - && useradd -u 1001 -r -g 0 -s /usr/sbin/nologin default \ - && LIBERTY_URL=${LIBERTY_URL:-$(wget -q -O - https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/downloads/wlp/index.yml | grep -E "^\s*kernel:.*${LIBERTY_VERSION}\.zip" | sed -n 's/\s*kernel:\s//p' | tr -d '\r' )} \ - && if [ ! -f /tmp/wlp.zip ]; then wget $DOWNLOAD_OPTIONS $LIBERTY_URL -U UA-IBM-WebSphere-Liberty-Docker -O /tmp/wlp.zip; fi \ - && unzip -q /tmp/wlp.zip -d /opt/ibm \ - && chown -R 1001:0 /opt/ibm/wlp \ - && chmod -R g+rw /opt/ibm/wlp \ - && cp -a /opt/ibm/wlp/lafiles/. /licenses/ - FROM ibmjava:8-jre USER root @@ -95,20 +69,27 @@ RUN set -eux; \ curl -LfsSo /usr/bin/dumb-init ${DUMB_INIT_URL}; \ echo "${DUMB_INIT_SHA256} */usr/bin/dumb-init" | sha256sum -c -; \ chmod +x /usr/bin/dumb-init; \ - apt-get purge --auto-remove -y wget; \ + apt-get purge --auto-remove -y curl; \ rm -rf /var/lib/apt/lists/*; -# Add default user 1001 and create wlp with right user/permissions before copying -RUN useradd -u 1001 -r -g 0 -s /usr/sbin/nologin default \ - && mkdir -p /opt/ibm/wlp \ - && chown -R 1001:0 /opt/ibm/wlp \ - && chmod -R g+rw /opt/ibm/wlp - -# Copy the runtime and licenses -COPY --from=getRuntime --chown=1001:0 /opt/ibm/wlp /opt/ibm/wlp -COPY --from=getRuntime /licenses /licenses +# Install WebSphere Liberty +ARG LIBERTY_URL +ARG DOWNLOAD_OPTIONS="" -RUN apt-get install -y --no-install-recommends openssl \ +RUN apt-get update \ + && apt-get install -y --no-install-recommends unzip wget openssl \ + && rm -rf /var/lib/apt/lists/* \ + && mkdir -p /licenses/ \ + && useradd -u 1001 -r -g 0 -s /usr/sbin/nologin default \ + && LIBERTY_URL=${LIBERTY_URL:-$(wget -q -O - https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/downloads/wlp/index.yml | grep -E "^\s*kernel:.*${LIBERTY_VERSION}\.zip" | sed -n 's/\s*kernel:\s//p' | tr -d '\r' )} \ + && wget $DOWNLOAD_OPTIONS $LIBERTY_URL -U UA-IBM-WebSphere-Liberty-Docker -O /tmp/wlp.zip \ + && unzip -q /tmp/wlp.zip -d /opt/ibm \ + && rm /tmp/wlp.zip \ + && chown -R 1001:0 /opt/ibm/wlp \ + && chmod -R g+rw /opt/ibm/wlp \ + && cp -a /opt/ibm/wlp/lafiles/. /licenses/ \ + && apt-get purge --auto-remove -y unzip \ + && apt-get purge --auto-remove -y wget \ && rm -rf /var/lib/apt/lists/* # Set Path Shortcuts @@ -135,7 +116,7 @@ RUN mkdir /logs \ && rm -rf /output \ && ln -s $WLP_OUTPUT_DIR/defaultServer /output \ && ln -s /opt/ibm/wlp/usr/servers/defaultServer /config \ - && ln -s /opt/ibm /liberty \ + && ln -s /opt/ibm/wlp /liberty \ && ln -s /opt/ibm/fixes /fixes \ && ln -s /opt/ibm/wlp/usr/shared/resources/lib.index.cache /lib.index.cache \ && mkdir -p /config/configDropins/defaults \ diff --git a/ga/23.0.0.7/kernel/Dockerfile.ubuntu.openjdk11 b/ga/23.0.0.7/kernel/Dockerfile.ubuntu.openjdk11 index 808d8dac3..727d9ad06 100644 --- a/ga/23.0.0.7/kernel/Dockerfile.ubuntu.openjdk11 +++ b/ga/23.0.0.7/kernel/Dockerfile.ubuntu.openjdk11 @@ -12,33 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM ibm-semeru-runtimes:open-11-jre-focal AS getRuntime - -USER root - -ARG VERBOSE=false - -# Install WebSphere Liberty -ARG LIBERTY_VERSION=23.0.0.7 -ARG LIBERTY_URL -ARG DOWNLOAD_OPTIONS="" - -# If there is a local copy of the image use that instead -COPY resources/ /tmp/ - -RUN apt-get update \ - && apt-get install -y --no-install-recommends unzip wget openssl \ - && rm -rf /var/lib/apt/lists/* \ - && mkdir -p /licenses/ \ - && useradd -u 1001 -r -g 0 -s /usr/sbin/nologin default \ - && LIBERTY_URL=${LIBERTY_URL:-$(wget -q -O - https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/downloads/wlp/index.yml | grep -E "^\s*kernel:.*${LIBERTY_VERSION}\.zip" | sed -n 's/\s*kernel:\s//p' | tr -d '\r' )} \ - && if [ ! -f /tmp/wlp.zip ]; then wget $DOWNLOAD_OPTIONS $LIBERTY_URL -U UA-IBM-WebSphere-Liberty-Docker -O /tmp/wlp.zip; fi \ - && unzip -q /tmp/wlp.zip -d /opt/ibm \ - && chown -R 1001:0 /opt/ibm/wlp \ - && chmod -R g+rw /opt/ibm/wlp \ - && cp -a /opt/ibm/wlp/lafiles/. /licenses/ - -FROM ibm-semeru-runtimes:open-11-jre-focal +FROM ibm-semeru-runtimes:open-11-jre-jammy USER root @@ -94,17 +68,23 @@ RUN set -eux; \ echo "${DUMB_INIT_SHA256} */usr/bin/dumb-init" | sha256sum -c -; \ chmod +x /usr/bin/dumb-init; -# Add default user 1001 and create wlp with right user/permissions before copying -RUN useradd -u 1001 -r -g 0 -s /usr/sbin/nologin default \ - && mkdir -p /opt/ibm/wlp \ +# Install WebSphere Liberty +ARG LIBERTY_URL +ARG DOWNLOAD_OPTIONS="" +RUN apt-get update \ + && apt-get install -y --no-install-recommends unzip openssl wget \ + && rm -rf /var/lib/apt/lists/* \ + && mkdir -p /licenses/ \ + && useradd -u 1001 -r -g 0 -s /usr/sbin/nologin default \ + && LIBERTY_URL=${LIBERTY_URL:-$(wget -q -O - https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/downloads/wlp/index.yml | grep -E "^\s*kernel:.*${LIBERTY_VERSION}\.zip" | sed -n 's/\s*kernel:\s//p' | tr -d '\r' )} \ + && wget $DOWNLOAD_OPTIONS $LIBERTY_URL -U UA-IBM-WebSphere-Liberty-Docker -O /tmp/wlp.zip \ + && unzip -q /tmp/wlp.zip -d /opt/ibm \ + && rm /tmp/wlp.zip \ && chown -R 1001:0 /opt/ibm/wlp \ - && chmod -R g+rw /opt/ibm/wlp - -# Copy the runtime and licenses -COPY --from=getRuntime --chown=1001:0 /opt/ibm/wlp /opt/ibm/wlp -COPY --from=getRuntime /licenses /licenses - -RUN apt-get install -y --no-install-recommends openssl \ + && chmod -R g+rw /opt/ibm/wlp \ + && cp -a /opt/ibm/wlp/lafiles/. /licenses/ \ + && apt-get purge --auto-remove -y unzip \ + && apt-get purge --auto-remove -y wget \ && rm -rf /var/lib/apt/lists/* # Set Path Shortcuts @@ -131,7 +111,7 @@ RUN mkdir /logs \ && rm -rf /output \ && ln -s $WLP_OUTPUT_DIR/defaultServer /output \ && ln -s /opt/ibm/wlp/usr/servers/defaultServer /config \ - && ln -s /opt/ibm /liberty \ + && ln -s /opt/ibm/wlp /liberty \ && ln -s /opt/ibm/fixes /fixes \ && ln -s /opt/ibm/wlp/usr/shared/resources/lib.index.cache /lib.index.cache \ && mkdir -p /config/configDropins/defaults \ diff --git a/ga/23.0.0.7/kernel/Dockerfile.ubuntu.openjdk17 b/ga/23.0.0.7/kernel/Dockerfile.ubuntu.openjdk17 index f0bc89464..6bd2eeba2 100644 --- a/ga/23.0.0.7/kernel/Dockerfile.ubuntu.openjdk17 +++ b/ga/23.0.0.7/kernel/Dockerfile.ubuntu.openjdk17 @@ -12,33 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM ibm-semeru-runtimes:open-17-jre-focal AS getRuntime - -USER root - -ARG VERBOSE=false - -# Install WebSphere Liberty -ARG LIBERTY_VERSION=23.0.0.7 -ARG LIBERTY_URL -ARG DOWNLOAD_OPTIONS="" - -# If there is a local copy of the image use that instead -COPY resources/ /tmp/ - -RUN apt-get update \ - && apt-get install -y --no-install-recommends unzip wget openssl \ - && rm -rf /var/lib/apt/lists/* \ - && mkdir -p /licenses/ \ - && useradd -u 1001 -r -g 0 -s /usr/sbin/nologin default \ - && LIBERTY_URL=${LIBERTY_URL:-$(wget -q -O - https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/downloads/wlp/index.yml | grep -E "^\s*kernel:.*${LIBERTY_VERSION}\.zip" | sed -n 's/\s*kernel:\s//p' | tr -d '\r' )} \ - && if [ ! -f /tmp/wlp.zip ]; then wget $DOWNLOAD_OPTIONS $LIBERTY_URL -U UA-IBM-WebSphere-Liberty-Docker -O /tmp/wlp.zip; fi \ - && unzip -q /tmp/wlp.zip -d /opt/ibm \ - && chown -R 1001:0 /opt/ibm/wlp \ - && chmod -R g+rw /opt/ibm/wlp \ - && cp -a /opt/ibm/wlp/lafiles/. /licenses/ - -FROM ibm-semeru-runtimes:open-17-jre-focal +FROM ibm-semeru-runtimes:open-17-jre-jammy USER root @@ -94,17 +68,23 @@ RUN set -eux; \ echo "${DUMB_INIT_SHA256} */usr/bin/dumb-init" | sha256sum -c -; \ chmod +x /usr/bin/dumb-init; -# Add default user 1001 and create wlp with right user/permissions before copying -RUN useradd -u 1001 -r -g 0 -s /usr/sbin/nologin default \ - && mkdir -p /opt/ibm/wlp \ +# Install WebSphere Liberty +ARG LIBERTY_URL +ARG DOWNLOAD_OPTIONS="" +RUN apt-get update \ + && apt-get install -y --no-install-recommends unzip openssl wget \ + && rm -rf /var/lib/apt/lists/* \ + && mkdir -p /licenses/ \ + && useradd -u 1001 -r -g 0 -s /usr/sbin/nologin default \ + && LIBERTY_URL=${LIBERTY_URL:-$(wget -q -O - https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/downloads/wlp/index.yml | grep -E "^\s*kernel:.*${LIBERTY_VERSION}\.zip" | sed -n 's/\s*kernel:\s//p' | tr -d '\r' )} \ + && wget $DOWNLOAD_OPTIONS $LIBERTY_URL -U UA-IBM-WebSphere-Liberty-Docker -O /tmp/wlp.zip \ + && unzip -q /tmp/wlp.zip -d /opt/ibm \ + && rm /tmp/wlp.zip \ && chown -R 1001:0 /opt/ibm/wlp \ - && chmod -R g+rw /opt/ibm/wlp - -# Copy the runtime and licenses -COPY --from=getRuntime --chown=1001:0 /opt/ibm/wlp /opt/ibm/wlp -COPY --from=getRuntime /licenses /licenses - -RUN apt-get install -y --no-install-recommends openssl \ + && chmod -R g+rw /opt/ibm/wlp \ + && cp -a /opt/ibm/wlp/lafiles/. /licenses/ \ + && apt-get purge --auto-remove -y unzip \ + && apt-get purge --auto-remove -y wget \ && rm -rf /var/lib/apt/lists/* # Set Path Shortcuts @@ -131,7 +111,7 @@ RUN mkdir /logs \ && rm -rf /output \ && ln -s $WLP_OUTPUT_DIR/defaultServer /output \ && ln -s /opt/ibm/wlp/usr/servers/defaultServer /config \ - && ln -s /opt/ibm /liberty \ + && ln -s /opt/ibm/wlp /liberty \ && ln -s /opt/ibm/fixes /fixes \ && ln -s /opt/ibm/wlp/usr/shared/resources/lib.index.cache /lib.index.cache \ && mkdir -p /config/configDropins/defaults \ diff --git a/ga/23.0.0.7/kernel/helpers/build/populate_scc.sh b/ga/23.0.0.7/kernel/helpers/build/populate_scc.sh index 8f65ec392..3c07a4e92 100755 --- a/ga/23.0.0.7/kernel/helpers/build/populate_scc.sh +++ b/ga/23.0.0.7/kernel/helpers/build/populate_scc.sh @@ -97,7 +97,8 @@ if [ $TRIM_SCC == yes ] then echo "Calculating SCC layer upper bound, starting with initial size $SCC_SIZE." # Populate the newly created class cache layer. - /opt/ibm/wlp/bin/server start && /opt/ibm/wlp/bin/server stop + /opt/ibm/wlp/bin/server start + /opt/ibm/wlp/bin/server stop # Find out how full it is. FULL=`( java $PRINT_LAYER_STATS || true ) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}'` echo "SCC layer is $FULL% full. Destroying layer." @@ -120,7 +121,8 @@ fi # Server start/stop to populate the /output/workarea and make subsequent server starts faster. for ((i=0; i<$ITERATIONS; i++)) do - /opt/ibm/wlp/bin/server start && /opt/ibm/wlp/bin/server stop + /opt/ibm/wlp/bin/server start + /opt/ibm/wlp/bin/server stop done # restore umask diff --git a/ga/latest/full/Dockerfile.ubi.ibmjava8 b/ga/latest/full/Dockerfile.ubi.ibmjava8 index 2a2aef089..8323de579 100644 --- a/ga/latest/full/Dockerfile.ubi.ibmjava8 +++ b/ga/latest/full/Dockerfile.ubi.ibmjava8 @@ -15,8 +15,6 @@ ARG PARENT_IMAGE=icr.io/appcafe/websphere-liberty:kernel-java8-ibmjava-ubi FROM $PARENT_IMAGE AS installBundle -USER root - ARG VERBOSE=false ARG REPOSITORIES_PROPERTIES="" @@ -43,7 +41,7 @@ FROM $PARENT_IMAGE ARG VERBOSE=false # Copy the runtime -COPY --from=installBundle /opt/ibm/wlp /opt/ibm/wlp +COPY --from=installBundle --chown=1001:0 /opt/ibm/wlp /opt/ibm/wlp COPY --chown=1001:0 server.xml /config/ diff --git a/ga/latest/full/Dockerfile.ubi.openjdk11 b/ga/latest/full/Dockerfile.ubi.openjdk11 index 79f2900b0..8669e3adf 100644 --- a/ga/latest/full/Dockerfile.ubi.openjdk11 +++ b/ga/latest/full/Dockerfile.ubi.openjdk11 @@ -15,8 +15,6 @@ ARG PARENT_IMAGE=icr.io/appcafe/websphere-liberty:kernel-java11-openj9-ubi FROM $PARENT_IMAGE AS installBundle -USER root - ARG VERBOSE=false ARG REPOSITORIES_PROPERTIES="" @@ -43,7 +41,7 @@ FROM $PARENT_IMAGE ARG VERBOSE=false # Copy the runtime -COPY --from=installBundle /opt/ibm/wlp /opt/ibm/wlp +COPY --from=installBundle --chown=1001:0 /opt/ibm/wlp /opt/ibm/wlp COPY --chown=1001:0 server.xml /config/ diff --git a/ga/latest/full/Dockerfile.ubi.openjdk17 b/ga/latest/full/Dockerfile.ubi.openjdk17 index dc91e1978..e38227406 100644 --- a/ga/latest/full/Dockerfile.ubi.openjdk17 +++ b/ga/latest/full/Dockerfile.ubi.openjdk17 @@ -15,8 +15,6 @@ ARG PARENT_IMAGE=icr.io/appcafe/websphere-liberty:kernel-java17-openj9-ubi FROM $PARENT_IMAGE AS installBundle -USER root - ARG VERBOSE=false ARG REPOSITORIES_PROPERTIES="" @@ -43,7 +41,7 @@ FROM $PARENT_IMAGE ARG VERBOSE=false # Copy the runtime -COPY --from=installBundle /opt/ibm/wlp /opt/ibm/wlp +COPY --from=installBundle --chown=1001:0 /opt/ibm/wlp /opt/ibm/wlp COPY --chown=1001:0 server.xml /config/ diff --git a/ga/latest/full/Dockerfile.ubi.openjdk8 b/ga/latest/full/Dockerfile.ubi.openjdk8 index 1d700de48..0081f5719 100644 --- a/ga/latest/full/Dockerfile.ubi.openjdk8 +++ b/ga/latest/full/Dockerfile.ubi.openjdk8 @@ -15,8 +15,6 @@ ARG PARENT_IMAGE=icr.io/appcafe/websphere-liberty:kernel-java8-openj9-ubi FROM $PARENT_IMAGE AS installBundle -USER root - ARG VERBOSE=false ARG REPOSITORIES_PROPERTIES="" @@ -43,7 +41,7 @@ FROM $PARENT_IMAGE ARG VERBOSE=false # Copy the runtime -COPY --from=installBundle /opt/ibm/wlp /opt/ibm/wlp +COPY --from=installBundle --chown=1001:0 /opt/ibm/wlp /opt/ibm/wlp COPY --chown=1001:0 server.xml /config/ diff --git a/ga/latest/full/Dockerfile.ubuntu.ibmjava8 b/ga/latest/full/Dockerfile.ubuntu.ibmjava8 index 395a6922a..c301dfec2 100644 --- a/ga/latest/full/Dockerfile.ubuntu.ibmjava8 +++ b/ga/latest/full/Dockerfile.ubuntu.ibmjava8 @@ -12,38 +12,27 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM websphere-liberty:kernel AS installBundle +FROM websphere-liberty:kernel-java8-ibmjava + ARG VERBOSE=false ARG REPOSITORIES_PROPERTIES="" -# If there is a local copy of the repository use that instead -COPY resources/ /tmp/ - # Install the base bundle RUN set -eux; \ if [ ! -z "$REPOSITORIES_PROPERTIES" ]; then \ mkdir /opt/ibm/wlp/etc/; \ echo "$REPOSITORIES_PROPERTIES" > /opt/ibm/wlp/etc/repositories.properties; \ - installUtility install --acceptLicense baseBundle; \ + fi; \ + installUtility install --acceptLicense baseBundle; \ + if [ ! -z "$REPOSITORIES_PROPERTIES" ]; then \ rm /opt/ibm/wlp/etc/repositories.properties; \ - elif [ -f /tmp/wlpRepo.zip ]; then \ - installUtility install --acceptLicense baseBundle --from=/tmp/wlpRepo.zip; \ - else \ - installUtility install --acceptLicense baseBundle; \ fi; \ rm -rf /output/workarea /output/logs; \ find /opt/ibm/wlp ! -perm -g=rw -print0 | xargs -r -0 chmod g+rw; -FROM websphere-liberty:kernel -ARG VERBOSE=false - -# Copy the runtime -COPY --from=installBundle /opt/ibm/wlp /opt/ibm/wlp - COPY --chown=1001:0 server.xml /config/ # Create a new SCC layer RUN if [ "$OPENJ9_SCC" = "true" ]; then populate_scc.sh; fi \ && rm -rf /output/messaging /output/resources/security /logs/* $WLP_OUTPUT_DIR/.classCache \ && find /opt/ibm/wlp/output ! -path "*.classCache*" ! -perm -g=rwx -print0 | xargs -0 -r chmod g+rwx - diff --git a/ga/latest/full/Dockerfile.ubuntu.openjdk11 b/ga/latest/full/Dockerfile.ubuntu.openjdk11 index 02fd841cd..305136390 100644 --- a/ga/latest/full/Dockerfile.ubuntu.openjdk11 +++ b/ga/latest/full/Dockerfile.ubuntu.openjdk11 @@ -12,37 +12,24 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM websphere-liberty:kernel-java11-openj9 AS installBundle - -USER root +FROM websphere-liberty:kernel-java11-openj9 ARG VERBOSE=false ARG REPOSITORIES_PROPERTIES="" -# If there is a local copy of the repository use that instead -COPY resources/ /tmp/ - # Install the base bundle RUN set -eux; \ if [ ! -z "$REPOSITORIES_PROPERTIES" ]; then \ mkdir /opt/ibm/wlp/etc/; \ echo "$REPOSITORIES_PROPERTIES" > /opt/ibm/wlp/etc/repositories.properties; \ - installUtility install --acceptLicense baseBundle; \ + fi; \ + installUtility install --acceptLicense baseBundle; \ + if [ ! -z "$REPOSITORIES_PROPERTIES" ]; then \ rm /opt/ibm/wlp/etc/repositories.properties; \ - elif [ -f /tmp/wlpRepo.zip ]; then \ - installUtility install --acceptLicense baseBundle --from=/tmp/wlpRepo.zip; \ - else \ - installUtility install --acceptLicense baseBundle; \ fi; \ rm -rf /output/workarea /output/logs; \ find /opt/ibm/wlp ! -perm -g=rw -print0 | xargs -r -0 chmod g+rw; -FROM websphere-liberty:kernel-java11-openj9 -ARG VERBOSE=false - -# Copy the runtime -COPY --from=installBundle /opt/ibm/wlp /opt/ibm/wlp - COPY --chown=1001:0 server.xml /config/ # Create a new SCC layer diff --git a/ga/latest/full/Dockerfile.ubuntu.openjdk17 b/ga/latest/full/Dockerfile.ubuntu.openjdk17 index 1241066c1..58d75c5a0 100644 --- a/ga/latest/full/Dockerfile.ubuntu.openjdk17 +++ b/ga/latest/full/Dockerfile.ubuntu.openjdk17 @@ -12,37 +12,24 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM websphere-liberty:kernel-java17-openj9 AS installBundle - -USER root +FROM websphere-liberty:kernel-java17-openj9 ARG VERBOSE=false ARG REPOSITORIES_PROPERTIES="" -# If there is a local copy of the repository use that instead -COPY resources/ /tmp/ - # Install the base bundle RUN set -eux; \ if [ ! -z "$REPOSITORIES_PROPERTIES" ]; then \ mkdir /opt/ibm/wlp/etc/; \ echo "$REPOSITORIES_PROPERTIES" > /opt/ibm/wlp/etc/repositories.properties; \ - installUtility install --acceptLicense baseBundle; \ + fi; \ + installUtility install --acceptLicense baseBundle; \ + if [ ! -z "$REPOSITORIES_PROPERTIES" ]; then \ rm /opt/ibm/wlp/etc/repositories.properties; \ - elif [ -f /tmp/wlpRepo.zip ]; then \ - installUtility install --acceptLicense baseBundle --from=/tmp/wlpRepo.zip; \ - else \ - installUtility install --acceptLicense baseBundle; \ fi; \ rm -rf /output/workarea /output/logs; \ find /opt/ibm/wlp ! -perm -g=rw -print0 | xargs -r -0 chmod g+rw; -FROM websphere-liberty:kernel-java17-openj9 -ARG VERBOSE=false - -# Copy the runtime -COPY --from=installBundle /opt/ibm/wlp /opt/ibm/wlp - COPY --chown=1001:0 server.xml /config/ # Create a new SCC layer diff --git a/ga/latest/kernel/Dockerfile.ubi.ibmjava8 b/ga/latest/kernel/Dockerfile.ubi.ibmjava8 index 9d5ac1c1e..0218db758 100644 --- a/ga/latest/kernel/Dockerfile.ubi.ibmjava8 +++ b/ga/latest/kernel/Dockerfile.ubi.ibmjava8 @@ -135,7 +135,7 @@ RUN mkdir /logs \ && rm -rf /output \ && ln -s $WLP_OUTPUT_DIR/defaultServer /output \ && ln -s /opt/ibm/wlp/usr/servers/defaultServer /config \ - && ln -s /opt/ibm /liberty \ + && ln -s /opt/ibm/wlp /liberty \ && ln -s /opt/ibm/fixes /fixes \ && ln -s /opt/ibm/wlp/usr/shared/resources/lib.index.cache /lib.index.cache \ && mkdir -p /config/configDropins/defaults \ diff --git a/ga/latest/kernel/Dockerfile.ubi.openjdk11 b/ga/latest/kernel/Dockerfile.ubi.openjdk11 index cbd5df5ec..b5882d924 100644 --- a/ga/latest/kernel/Dockerfile.ubi.openjdk11 +++ b/ga/latest/kernel/Dockerfile.ubi.openjdk11 @@ -135,7 +135,7 @@ RUN mkdir /logs \ && rm -rf /output \ && ln -s $WLP_OUTPUT_DIR/defaultServer /output \ && ln -s /opt/ibm/wlp/usr/servers/defaultServer /config \ - && ln -s /opt/ibm /liberty \ + && ln -s /opt/ibm/wlp /liberty \ && ln -s /opt/ibm/fixes /fixes \ && ln -s /opt/ibm/wlp/usr/shared/resources/lib.index.cache /lib.index.cache \ && mkdir -p /config/configDropins/defaults \ diff --git a/ga/latest/kernel/Dockerfile.ubi.openjdk17 b/ga/latest/kernel/Dockerfile.ubi.openjdk17 index bdf26a8a1..569932d85 100644 --- a/ga/latest/kernel/Dockerfile.ubi.openjdk17 +++ b/ga/latest/kernel/Dockerfile.ubi.openjdk17 @@ -135,7 +135,7 @@ RUN mkdir /logs \ && rm -rf /output \ && ln -s $WLP_OUTPUT_DIR/defaultServer /output \ && ln -s /opt/ibm/wlp/usr/servers/defaultServer /config \ - && ln -s /opt/ibm /liberty \ + && ln -s /opt/ibm/wlp /liberty \ && ln -s /opt/ibm/fixes /fixes \ && ln -s /opt/ibm/wlp/usr/shared/resources/lib.index.cache /lib.index.cache \ && mkdir -p /config/configDropins/defaults \ diff --git a/ga/latest/kernel/Dockerfile.ubi.openjdk8 b/ga/latest/kernel/Dockerfile.ubi.openjdk8 index 2484c6586..90927869d 100644 --- a/ga/latest/kernel/Dockerfile.ubi.openjdk8 +++ b/ga/latest/kernel/Dockerfile.ubi.openjdk8 @@ -135,7 +135,7 @@ RUN mkdir /logs \ && rm -rf /output \ && ln -s $WLP_OUTPUT_DIR/defaultServer /output \ && ln -s /opt/ibm/wlp/usr/servers/defaultServer /config \ - && ln -s /opt/ibm /liberty \ + && ln -s /opt/ibm/wlp /liberty \ && ln -s /opt/ibm/fixes /fixes \ && ln -s /opt/ibm/wlp/usr/shared/resources/lib.index.cache /lib.index.cache \ && mkdir -p /config/configDropins/defaults \ diff --git a/ga/latest/kernel/Dockerfile.ubuntu.ibmjava8 b/ga/latest/kernel/Dockerfile.ubuntu.ibmjava8 index 796d40ac0..0342ad8bb 100644 --- a/ga/latest/kernel/Dockerfile.ubuntu.ibmjava8 +++ b/ga/latest/kernel/Dockerfile.ubuntu.ibmjava8 @@ -12,32 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM ibmjava:8-jre AS getRuntime - -USER root - -ARG VERBOSE=false - -# Install WebSphere Liberty -ARG LIBERTY_VERSION=23.0.0.7 -ARG LIBERTY_URL -ARG DOWNLOAD_OPTIONS="" - -# If there is a local copy of the image use that instead -COPY resources/ /tmp/ - -RUN apt-get update \ - && apt-get install -y --no-install-recommends unzip wget openssl \ - && rm -rf /var/lib/apt/lists/* \ - && mkdir -p /licenses/ \ - && useradd -u 1001 -r -g 0 -s /usr/sbin/nologin default \ - && LIBERTY_URL=${LIBERTY_URL:-$(wget -q -O - https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/downloads/wlp/index.yml | grep -E "^\s*kernel:.*${LIBERTY_VERSION}\.zip" | sed -n 's/\s*kernel:\s//p' | tr -d '\r' )} \ - && if [ ! -f /tmp/wlp.zip ]; then wget $DOWNLOAD_OPTIONS $LIBERTY_URL -U UA-IBM-WebSphere-Liberty-Docker -O /tmp/wlp.zip; fi \ - && unzip -q /tmp/wlp.zip -d /opt/ibm \ - && chown -R 1001:0 /opt/ibm/wlp \ - && chmod -R g+rw /opt/ibm/wlp \ - && cp -a /opt/ibm/wlp/lafiles/. /licenses/ - FROM ibmjava:8-jre USER root @@ -95,20 +69,27 @@ RUN set -eux; \ curl -LfsSo /usr/bin/dumb-init ${DUMB_INIT_URL}; \ echo "${DUMB_INIT_SHA256} */usr/bin/dumb-init" | sha256sum -c -; \ chmod +x /usr/bin/dumb-init; \ - apt-get purge --auto-remove -y wget; \ + apt-get purge --auto-remove -y curl; \ rm -rf /var/lib/apt/lists/*; -# Add default user 1001 and create wlp with right user/permissions before copying -RUN useradd -u 1001 -r -g 0 -s /usr/sbin/nologin default \ - && mkdir -p /opt/ibm/wlp \ - && chown -R 1001:0 /opt/ibm/wlp \ - && chmod -R g+rw /opt/ibm/wlp - -# Copy the runtime and licenses -COPY --from=getRuntime --chown=1001:0 /opt/ibm/wlp /opt/ibm/wlp -COPY --from=getRuntime /licenses /licenses +# Install WebSphere Liberty +ARG LIBERTY_URL +ARG DOWNLOAD_OPTIONS="" -RUN apt-get install -y --no-install-recommends openssl \ +RUN apt-get update \ + && apt-get install -y --no-install-recommends unzip wget openssl \ + && rm -rf /var/lib/apt/lists/* \ + && mkdir -p /licenses/ \ + && useradd -u 1001 -r -g 0 -s /usr/sbin/nologin default \ + && LIBERTY_URL=${LIBERTY_URL:-$(wget -q -O - https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/downloads/wlp/index.yml | grep -E "^\s*kernel:.*${LIBERTY_VERSION}\.zip" | sed -n 's/\s*kernel:\s//p' | tr -d '\r' )} \ + && wget $DOWNLOAD_OPTIONS $LIBERTY_URL -U UA-IBM-WebSphere-Liberty-Docker -O /tmp/wlp.zip \ + && unzip -q /tmp/wlp.zip -d /opt/ibm \ + && rm /tmp/wlp.zip \ + && chown -R 1001:0 /opt/ibm/wlp \ + && chmod -R g+rw /opt/ibm/wlp \ + && cp -a /opt/ibm/wlp/lafiles/. /licenses/ \ + && apt-get purge --auto-remove -y unzip \ + && apt-get purge --auto-remove -y wget \ && rm -rf /var/lib/apt/lists/* # Set Path Shortcuts @@ -135,7 +116,7 @@ RUN mkdir /logs \ && rm -rf /output \ && ln -s $WLP_OUTPUT_DIR/defaultServer /output \ && ln -s /opt/ibm/wlp/usr/servers/defaultServer /config \ - && ln -s /opt/ibm /liberty \ + && ln -s /opt/ibm/wlp /liberty \ && ln -s /opt/ibm/fixes /fixes \ && ln -s /opt/ibm/wlp/usr/shared/resources/lib.index.cache /lib.index.cache \ && mkdir -p /config/configDropins/defaults \ diff --git a/ga/latest/kernel/Dockerfile.ubuntu.openjdk11 b/ga/latest/kernel/Dockerfile.ubuntu.openjdk11 index 808d8dac3..727d9ad06 100644 --- a/ga/latest/kernel/Dockerfile.ubuntu.openjdk11 +++ b/ga/latest/kernel/Dockerfile.ubuntu.openjdk11 @@ -12,33 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM ibm-semeru-runtimes:open-11-jre-focal AS getRuntime - -USER root - -ARG VERBOSE=false - -# Install WebSphere Liberty -ARG LIBERTY_VERSION=23.0.0.7 -ARG LIBERTY_URL -ARG DOWNLOAD_OPTIONS="" - -# If there is a local copy of the image use that instead -COPY resources/ /tmp/ - -RUN apt-get update \ - && apt-get install -y --no-install-recommends unzip wget openssl \ - && rm -rf /var/lib/apt/lists/* \ - && mkdir -p /licenses/ \ - && useradd -u 1001 -r -g 0 -s /usr/sbin/nologin default \ - && LIBERTY_URL=${LIBERTY_URL:-$(wget -q -O - https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/downloads/wlp/index.yml | grep -E "^\s*kernel:.*${LIBERTY_VERSION}\.zip" | sed -n 's/\s*kernel:\s//p' | tr -d '\r' )} \ - && if [ ! -f /tmp/wlp.zip ]; then wget $DOWNLOAD_OPTIONS $LIBERTY_URL -U UA-IBM-WebSphere-Liberty-Docker -O /tmp/wlp.zip; fi \ - && unzip -q /tmp/wlp.zip -d /opt/ibm \ - && chown -R 1001:0 /opt/ibm/wlp \ - && chmod -R g+rw /opt/ibm/wlp \ - && cp -a /opt/ibm/wlp/lafiles/. /licenses/ - -FROM ibm-semeru-runtimes:open-11-jre-focal +FROM ibm-semeru-runtimes:open-11-jre-jammy USER root @@ -94,17 +68,23 @@ RUN set -eux; \ echo "${DUMB_INIT_SHA256} */usr/bin/dumb-init" | sha256sum -c -; \ chmod +x /usr/bin/dumb-init; -# Add default user 1001 and create wlp with right user/permissions before copying -RUN useradd -u 1001 -r -g 0 -s /usr/sbin/nologin default \ - && mkdir -p /opt/ibm/wlp \ +# Install WebSphere Liberty +ARG LIBERTY_URL +ARG DOWNLOAD_OPTIONS="" +RUN apt-get update \ + && apt-get install -y --no-install-recommends unzip openssl wget \ + && rm -rf /var/lib/apt/lists/* \ + && mkdir -p /licenses/ \ + && useradd -u 1001 -r -g 0 -s /usr/sbin/nologin default \ + && LIBERTY_URL=${LIBERTY_URL:-$(wget -q -O - https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/downloads/wlp/index.yml | grep -E "^\s*kernel:.*${LIBERTY_VERSION}\.zip" | sed -n 's/\s*kernel:\s//p' | tr -d '\r' )} \ + && wget $DOWNLOAD_OPTIONS $LIBERTY_URL -U UA-IBM-WebSphere-Liberty-Docker -O /tmp/wlp.zip \ + && unzip -q /tmp/wlp.zip -d /opt/ibm \ + && rm /tmp/wlp.zip \ && chown -R 1001:0 /opt/ibm/wlp \ - && chmod -R g+rw /opt/ibm/wlp - -# Copy the runtime and licenses -COPY --from=getRuntime --chown=1001:0 /opt/ibm/wlp /opt/ibm/wlp -COPY --from=getRuntime /licenses /licenses - -RUN apt-get install -y --no-install-recommends openssl \ + && chmod -R g+rw /opt/ibm/wlp \ + && cp -a /opt/ibm/wlp/lafiles/. /licenses/ \ + && apt-get purge --auto-remove -y unzip \ + && apt-get purge --auto-remove -y wget \ && rm -rf /var/lib/apt/lists/* # Set Path Shortcuts @@ -131,7 +111,7 @@ RUN mkdir /logs \ && rm -rf /output \ && ln -s $WLP_OUTPUT_DIR/defaultServer /output \ && ln -s /opt/ibm/wlp/usr/servers/defaultServer /config \ - && ln -s /opt/ibm /liberty \ + && ln -s /opt/ibm/wlp /liberty \ && ln -s /opt/ibm/fixes /fixes \ && ln -s /opt/ibm/wlp/usr/shared/resources/lib.index.cache /lib.index.cache \ && mkdir -p /config/configDropins/defaults \ diff --git a/ga/latest/kernel/Dockerfile.ubuntu.openjdk17 b/ga/latest/kernel/Dockerfile.ubuntu.openjdk17 index f0bc89464..6bd2eeba2 100644 --- a/ga/latest/kernel/Dockerfile.ubuntu.openjdk17 +++ b/ga/latest/kernel/Dockerfile.ubuntu.openjdk17 @@ -12,33 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM ibm-semeru-runtimes:open-17-jre-focal AS getRuntime - -USER root - -ARG VERBOSE=false - -# Install WebSphere Liberty -ARG LIBERTY_VERSION=23.0.0.7 -ARG LIBERTY_URL -ARG DOWNLOAD_OPTIONS="" - -# If there is a local copy of the image use that instead -COPY resources/ /tmp/ - -RUN apt-get update \ - && apt-get install -y --no-install-recommends unzip wget openssl \ - && rm -rf /var/lib/apt/lists/* \ - && mkdir -p /licenses/ \ - && useradd -u 1001 -r -g 0 -s /usr/sbin/nologin default \ - && LIBERTY_URL=${LIBERTY_URL:-$(wget -q -O - https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/downloads/wlp/index.yml | grep -E "^\s*kernel:.*${LIBERTY_VERSION}\.zip" | sed -n 's/\s*kernel:\s//p' | tr -d '\r' )} \ - && if [ ! -f /tmp/wlp.zip ]; then wget $DOWNLOAD_OPTIONS $LIBERTY_URL -U UA-IBM-WebSphere-Liberty-Docker -O /tmp/wlp.zip; fi \ - && unzip -q /tmp/wlp.zip -d /opt/ibm \ - && chown -R 1001:0 /opt/ibm/wlp \ - && chmod -R g+rw /opt/ibm/wlp \ - && cp -a /opt/ibm/wlp/lafiles/. /licenses/ - -FROM ibm-semeru-runtimes:open-17-jre-focal +FROM ibm-semeru-runtimes:open-17-jre-jammy USER root @@ -94,17 +68,23 @@ RUN set -eux; \ echo "${DUMB_INIT_SHA256} */usr/bin/dumb-init" | sha256sum -c -; \ chmod +x /usr/bin/dumb-init; -# Add default user 1001 and create wlp with right user/permissions before copying -RUN useradd -u 1001 -r -g 0 -s /usr/sbin/nologin default \ - && mkdir -p /opt/ibm/wlp \ +# Install WebSphere Liberty +ARG LIBERTY_URL +ARG DOWNLOAD_OPTIONS="" +RUN apt-get update \ + && apt-get install -y --no-install-recommends unzip openssl wget \ + && rm -rf /var/lib/apt/lists/* \ + && mkdir -p /licenses/ \ + && useradd -u 1001 -r -g 0 -s /usr/sbin/nologin default \ + && LIBERTY_URL=${LIBERTY_URL:-$(wget -q -O - https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/downloads/wlp/index.yml | grep -E "^\s*kernel:.*${LIBERTY_VERSION}\.zip" | sed -n 's/\s*kernel:\s//p' | tr -d '\r' )} \ + && wget $DOWNLOAD_OPTIONS $LIBERTY_URL -U UA-IBM-WebSphere-Liberty-Docker -O /tmp/wlp.zip \ + && unzip -q /tmp/wlp.zip -d /opt/ibm \ + && rm /tmp/wlp.zip \ && chown -R 1001:0 /opt/ibm/wlp \ - && chmod -R g+rw /opt/ibm/wlp - -# Copy the runtime and licenses -COPY --from=getRuntime --chown=1001:0 /opt/ibm/wlp /opt/ibm/wlp -COPY --from=getRuntime /licenses /licenses - -RUN apt-get install -y --no-install-recommends openssl \ + && chmod -R g+rw /opt/ibm/wlp \ + && cp -a /opt/ibm/wlp/lafiles/. /licenses/ \ + && apt-get purge --auto-remove -y unzip \ + && apt-get purge --auto-remove -y wget \ && rm -rf /var/lib/apt/lists/* # Set Path Shortcuts @@ -131,7 +111,7 @@ RUN mkdir /logs \ && rm -rf /output \ && ln -s $WLP_OUTPUT_DIR/defaultServer /output \ && ln -s /opt/ibm/wlp/usr/servers/defaultServer /config \ - && ln -s /opt/ibm /liberty \ + && ln -s /opt/ibm/wlp /liberty \ && ln -s /opt/ibm/fixes /fixes \ && ln -s /opt/ibm/wlp/usr/shared/resources/lib.index.cache /lib.index.cache \ && mkdir -p /config/configDropins/defaults \ diff --git a/ga/latest/kernel/helpers/build/populate_scc.sh b/ga/latest/kernel/helpers/build/populate_scc.sh index 8f65ec392..3c07a4e92 100755 --- a/ga/latest/kernel/helpers/build/populate_scc.sh +++ b/ga/latest/kernel/helpers/build/populate_scc.sh @@ -97,7 +97,8 @@ if [ $TRIM_SCC == yes ] then echo "Calculating SCC layer upper bound, starting with initial size $SCC_SIZE." # Populate the newly created class cache layer. - /opt/ibm/wlp/bin/server start && /opt/ibm/wlp/bin/server stop + /opt/ibm/wlp/bin/server start + /opt/ibm/wlp/bin/server stop # Find out how full it is. FULL=`( java $PRINT_LAYER_STATS || true ) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}'` echo "SCC layer is $FULL% full. Destroying layer." @@ -120,7 +121,8 @@ fi # Server start/stop to populate the /output/workarea and make subsequent server starts faster. for ((i=0; i<$ITERATIONS; i++)) do - /opt/ibm/wlp/bin/server start && /opt/ibm/wlp/bin/server stop + /opt/ibm/wlp/bin/server start + /opt/ibm/wlp/bin/server stop done # restore umask diff --git a/test/verify.sh b/test/verify.sh index 045170066..b82aedaae 100755 --- a/test/verify.sh +++ b/test/verify.sh @@ -43,7 +43,7 @@ main () { local tests=$(declare -F | cut -d" " -f3 | grep "^test") echo "****** Testing ${IMAGE}..." - for name in "${tests}"; do + for name in $tests; do timestamp=$(date '+%Y/%m/%d %H:%M:%S') echo "${timestamp} *** ${name} - Executing" eval "${name}" @@ -99,9 +99,9 @@ testLibertyStopsAndRestarts() if [ "$1" == "OpenShift" ]; then timestamp=$(date '+%Y/%m/%d %H:%M:%S') echo "$timestamp *** testLibertyStopsAndRestarts on OpenShift" - cid=$(docker run -d -u 1001:0 $IMAGE) + local cid=$(docker run -d -u 1001:0 $IMAGE) else - local cid=$(docker run -d $IMAGE) + local cid=$(docker run -d $IMAGE) fi echo "Waiting for server to start..." waitForServerStart "${cid}" \