Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't build docker image #487

Open
blueapple168 opened this issue Dec 17, 2020 · 3 comments
Open

Don't build docker image #487

blueapple168 opened this issue Dec 17, 2020 · 3 comments
Assignees
Labels

Comments

@blueapple168
Copy link

blueapple168 commented Dec 17, 2020

https://github.com/AdoptOpenJDK/openjdk-docker/blob/master/8/jdk/alpine/Dockerfile.openj9.releases.slim

FULL=$( (java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,printallStats 2>&1 || true) | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}')

echo $( (java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,printallStats 2>&1 || true) | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}')

vaule is none。。
image

SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}")
ERROR 50* / 100.0

@blueapple168 blueapple168 changed the title don't buid docker image Don't build docker image Dec 17, 2020
@karianna karianna added the bug label Dec 17, 2020
@bharathappali
Copy link
Collaborator

@blueapple168 I have tried to build docker image with the Dockerfile you mentioned and I was able to build the image

$ docker build -t alpine-scc-test -f 8/jdk/alpine/Dockerfile.openj9.releases.slim .
Sending build context to Docker daemon  20.47MB
Step 1/9 : FROM alpine:3.12
 ---> d6e46aa2470d
Step 2/9 : ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
 ---> Running in 9ca3e5ad401c
Removing intermediate container 9ca3e5ad401c
 ---> 33247f8f8069
Step 3/9 : RUN apk add --no-cache tzdata --virtual .build-deps curl binutils zstd     && GLIBC_VER="2.31-r0"     && ALPINE_GLIBC_REPO="https://github.com/sgerrand/alpine-pkg-glibc/releases/download"     && GCC_LIBS_URL="https://archive.archlinux.org/packages/g/gcc-libs/gcc-libs-10.1.0-2-x86_64.pkg.tar.zst"     && GCC_LIBS_SHA256="f80320a03ff73e82271064e4f684cd58d7dbdb07aa06a2c4eea8e0f3c507c45c"     && ZLIB_URL="https://archive.archlinux.org/packages/z/zlib/zlib-1%3A1.2.11-3-x86_64.pkg.tar.xz"     && ZLIB_SHA256=17aede0b9f8baa789c5aa3f358fbf8c68a5f1228c5e6cba1a5dd34102ef4d4e5     && curl -LfsS https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub -o /etc/apk/keys/sgerrand.rsa.pub     && SGERRAND_RSA_SHA256="823b54589c93b02497f1ba4dc622eaef9c813e6b0f0ebbb2f771e32adf9f4ef2"     && echo "${SGERRAND_RSA_SHA256} */etc/apk/keys/sgerrand.rsa.pub" | sha256sum -c -     && curl -LfsS ${ALPINE_GLIBC_REPO}/${GLIBC_VER}/glibc-${GLIBC_VER}.apk > /tmp/glibc-${GLIBC_VER}.apk     && apk add --no-cache /tmp/glibc-${GLIBC_VER}.apk     && curl -LfsS ${ALPINE_GLIBC_REPO}/${GLIBC_VER}/glibc-bin-${GLIBC_VER}.apk > /tmp/glibc-bin-${GLIBC_VER}.apk     && apk add --no-cache /tmp/glibc-bin-${GLIBC_VER}.apk     && curl -Ls ${ALPINE_GLIBC_REPO}/${GLIBC_VER}/glibc-i18n-${GLIBC_VER}.apk > /tmp/glibc-i18n-${GLIBC_VER}.apk     && apk add --no-cache /tmp/glibc-i18n-${GLIBC_VER}.apk     && /usr/glibc-compat/bin/localedef --force --inputfile POSIX --charmap UTF-8 "$LANG" || true     && echo "export LANG=$LANG" > /etc/profile.d/locale.sh     && curl -LfsS ${GCC_LIBS_URL} -o /tmp/gcc-libs.tar.zst     && echo "${GCC_LIBS_SHA256} */tmp/gcc-libs.tar.zst" | sha256sum -c -     && mkdir /tmp/gcc     && zstd -d /tmp/gcc-libs.tar.zst --output-dir-flat /tmp     && tar -xf /tmp/gcc-libs.tar -C /tmp/gcc     && mv /tmp/gcc/usr/lib/libgcc* /tmp/gcc/usr/lib/libstdc++* /usr/glibc-compat/lib     && strip /usr/glibc-compat/lib/libgcc_s.so.* /usr/glibc-compat/lib/libstdc++.so*     && curl -LfsS ${ZLIB_URL} -o /tmp/libz.tar.xz     && echo "${ZLIB_SHA256} */tmp/libz.tar.xz" | sha256sum -c -     && mkdir /tmp/libz     && tar -xf /tmp/libz.tar.xz -C /tmp/libz     && mv /tmp/libz/usr/lib/libz.so* /usr/glibc-compat/lib     && apk del --purge .build-deps glibc-i18n     && rm -rf /tmp/*.apk /tmp/gcc /tmp/gcc-libs.tar* /tmp/libz /tmp/libz.tar.xz /var/cache/apk/*
 ---> Running in e8dd251567c0
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/x86_64/APKINDEX.tar.gz
(1/10) Installing tzdata (2020c-r1)
(2/10) Installing ca-certificates (20191127-r4)
(3/10) Installing nghttp2-libs (1.41.0-r0)
(4/10) Installing libcurl (7.69.1-r3)
(5/10) Installing curl (7.69.1-r3)
(6/10) Installing libgcc (9.3.0-r2)
(7/10) Installing libstdc++ (9.3.0-r2)
(8/10) Installing binutils (2.34-r1)
(9/10) Installing zstd (1.4.5-r0)
(10/10) Installing .build-deps (20201218.170731)
Executing busybox-1.31.1-r19.trigger
Executing ca-certificates-20191127-r4.trigger
OK: 22 MiB in 24 packages
/etc/apk/keys/sgerrand.rsa.pub: OK
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/x86_64/APKINDEX.tar.gz
(1/1) Installing glibc (2.31-r0)
OK: 31 MiB in 25 packages
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/x86_64/APKINDEX.tar.gz
(1/1) Installing glibc-bin (2.31-r0)
Executing glibc-bin-2.31-r0.trigger
/usr/glibc-compat/sbin/ldconfig: /usr/glibc-compat/lib/ld-linux-x86-64.so.2 is not a symbolic link

OK: 33 MiB in 26 packages
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/x86_64/APKINDEX.tar.gz
(1/1) Installing glibc-i18n (2.31-r0)
OK: 59 MiB in 27 packages
failed to set locale!
[warning] No definition for LC_PAPER category found
failed to set locale!
[warning] No definition for LC_NAME category found
failed to set locale!
[warning] No definition for LC_ADDRESS category found
failed to set locale!
[warning] No definition for LC_TELEPHONE category found
failed to set locale!
[warning] No definition for LC_MEASUREMENT category found
failed to set locale!
[warning] No definition for LC_IDENTIFICATION category found
/tmp/gcc-libs.tar.zst: OK
/tmp/gcc-libs.tar.zst: 156098560 bytes                                         
/tmp/libz.tar.xz: OK
WARNING: Ignoring APKINDEX.2c4ac24e.tar.gz: No such file or directory
WARNING: Ignoring APKINDEX.40a3604f.tar.gz: No such file or directory
(1/10) Purging .build-deps (20201218.170731)
(2/10) Purging tzdata (2020c-r1)
(3/10) Purging curl (7.69.1-r3)
(4/10) Purging binutils (2.34-r1)
(5/10) Purging zstd (1.4.5-r0)
(6/10) Purging glibc-i18n (2.31-r0)
(7/10) Purging libcurl (7.69.1-r3)
(8/10) Purging ca-certificates (20191127-r4)
Executing ca-certificates-20191127-r4.post-deinstall
(9/10) Purging nghttp2-libs (1.41.0-r0)
(10/10) Purging libstdc++ (9.3.0-r2)
Executing busybox-1.31.1-r19.trigger
Executing glibc-bin-2.31-r0.trigger
/usr/glibc-compat/sbin/ldconfig: /usr/glibc-compat/lib/ld-linux-x86-64.so.2 is not a symbolic link

OK: 17 MiB in 17 packages
Removing intermediate container e8dd251567c0
 ---> eac2de58e245
Step 4/9 : ENV JAVA_VERSION jdk8u275-b01_openj9-0.23.0
 ---> Running in 57c039a88a78
Removing intermediate container 57c039a88a78
 ---> 3e2135b08dbd
Step 5/9 : COPY slim-java* /usr/local/bin/
 ---> 646d94ebea32
Step 6/9 : RUN set -eux;     apk add --no-cache --virtual .fetch-deps curl;     ARCH="$(apk --print-arch)";     case "${ARCH}" in        aarch64|arm64)          ESUM='0e5a8776fb475269c293bb9acf20665a634d9348c6c061109a5afbbfec70e71b';          BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u275-b01_openj9-0.23.0/OpenJDK8U-jdk_aarch64_linux_openj9_8u275b01_openj9-0.23.0.tar.gz';          ;;        ppc64el|ppc64le)          ESUM='ddf2a606534dce7f06c91c13b438bb986d42a3ff7a3f5d928d0ecb79a6ba13df';          BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u275-b01_openj9-0.23.0/OpenJDK8U-jdk_ppc64le_linux_openj9_8u275b01_openj9-0.23.0.tar.gz';          ;;        s390x)          ESUM='92c7c45b4403e900c0f94772f7bce0b085453d9727917e6255fa8a1821499bb1';          BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u275-b01_openj9-0.23.0/OpenJDK8U-jdk_s390x_linux_openj9_8u275b01_openj9-0.23.0.tar.gz';          ;;        amd64|x86_64)          ESUM='8bb74ff7ab2f64ced23212ee0520295c01b6f2d7558fd6e488a8ca795ced1ebd';          BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u275-b01_openj9-0.23.0/OpenJDK8U-jdk_x64_linux_openj9_8u275b01_openj9-0.23.0.tar.gz';          ;;        *)          echo "Unsupported arch: ${ARCH}";          exit 1;          ;;     esac;     curl -LfsSo /tmp/openjdk.tar.gz ${BINARY_URL};     echo "${ESUM} */tmp/openjdk.tar.gz" | sha256sum -c -;     mkdir -p /opt/java/openjdk;     cd /opt/java/openjdk;     tar -xf /tmp/openjdk.tar.gz --strip-components=1;     export PATH="/opt/java/openjdk/bin:$PATH";     apk add --no-cache --virtual .build-deps bash binutils;     /usr/local/bin/slim-java.sh /opt/java/openjdk;     apk del --purge .build-deps;     rm -rf /var/cache/apk/*;     apk del --purge .fetch-deps;     rm -rf /var/cache/apk/*;     rm -rf /tmp/openjdk.tar.gz;
 ---> Running in fd5bd150123b
+ apk add --no-cache --virtual .fetch-deps curl
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/x86_64/APKINDEX.tar.gz
(1/5) Installing ca-certificates (20191127-r4)
(2/5) Installing nghttp2-libs (1.41.0-r0)
(3/5) Installing libcurl (7.69.1-r3)
(4/5) Installing curl (7.69.1-r3)
(5/5) Installing .fetch-deps (20201218.170920)
Executing busybox-1.31.1-r19.trigger
Executing ca-certificates-20191127-r4.trigger
Executing glibc-bin-2.31-r0.trigger
/usr/glibc-compat/sbin/ldconfig: /usr/glibc-compat/lib/ld-linux-x86-64.so.2 is not a symbolic link

OK: 18 MiB in 22 packages
+ apk --print-arch
+ ARCH=x86_64
+ ESUM=8bb74ff7ab2f64ced23212ee0520295c01b6f2d7558fd6e488a8ca795ced1ebd
+ BINARY_URL=https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u275-b01_openj9-0.23.0/OpenJDK8U-jdk_x64_linux_openj9_8u275b01_openj9-0.23.0.tar.gz
+ curl -LfsSo /tmp/openjdk.tar.gz https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u275-b01_openj9-0.23.0/OpenJDK8U-jdk_x64_linux_openj9_8u275b01_openj9-0.23.0.tar.gz
+ + sha256sumecho -c - '8bb74ff7ab2f64ced23212ee0520295c01b6f2d7558fd6e488a8ca795ced1ebd */tmp/openjdk.tar.gz'

/tmp/openjdk.tar.gz: OK
+ mkdir -p /opt/java/openjdk
+ cd /opt/java/openjdk
+ tar -xf /tmp/openjdk.tar.gz '--strip-components=1'
+ export 'PATH=/opt/java/openjdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
+ apk add --no-cache --virtual .build-deps bash binutils
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/x86_64/APKINDEX.tar.gz
(1/7) Installing ncurses-terminfo-base (6.2_p20200523-r0)
(2/7) Installing ncurses-libs (6.2_p20200523-r0)
(3/7) Installing readline (8.0.4-r0)
(4/7) Installing bash (5.0.17-r0)
Executing bash-5.0.17-r0.post-install
(5/7) Installing libstdc++ (9.3.0-r2)
(6/7) Installing binutils (2.34-r1)
(7/7) Installing .build-deps (20201218.171358)
Executing busybox-1.31.1-r19.trigger
Executing glibc-bin-2.31-r0.trigger
/usr/glibc-compat/sbin/ldconfig: /usr/glibc-compat/lib/ld-linux-x86-64.so.2 is not a symbolic link

OK: 31 MiB in 29 packages
+ /usr/local/bin/slim-java.sh /opt/java/openjdk
Copying /opt/java/openjdk to /opt/java/slim...
Trimming files...
INFO: Trimming jre dir...done
INFO: Trimming jre/lib dir...done
INFO: Trimming classes in rt.jar.../usr/local/bin/slim-java.sh: line 194: /usr/local/bin/slim-java_rtjar_keep.list: No such file or directory
/usr/local/bin/slim-java.sh: line 200: /usr/local/bin/slim-java_rtjar_del.list: No such file or directory
cp: can't stat '/opt/java/slim/rt_keep_class/*': No such file or directory
done
INFO: Strip debug info from jar files
        Stripping debug info in ./lib/dt.jar
        Stripping debug info in ./lib/jconsole.jar
        Stripping debug info in ./lib/tools.jar
        Stripping debug info in ./jre/lib/ext/cldrdata.jar
        Stripping debug info in ./jre/lib/ext/sunec.jar
        Stripping debug info in ./jre/lib/ext/jaccess.jar
        Stripping debug info in ./jre/lib/ext/zipfs.jar
        Stripping debug info in ./jre/lib/ext/sunjce_provider.jar
        Stripping debug info in ./jre/lib/ext/localedata.jar
        Stripping debug info in ./jre/lib/ext/sunpkcs11.jar
        Stripping debug info in ./jre/lib/security/policy/unlimited/US_export_policy.jar
        Stripping debug info in ./jre/lib/security/policy/unlimited/local_policy.jar
        Stripping debug info in ./jre/lib/security/policy/limited/US_export_policy.jar
        Stripping debug info in ./jre/lib/security/policy/limited/local_policy.jar
        Stripping debug info in ./jre/lib/rt.jar
        Stripping debug info in ./jre/lib/charsets.jar
        Stripping debug info in ./jre/lib/resources.jar
        Stripping debug info in ./jre/lib/jce.jar
        Stripping debug info in ./jre/lib/management-agent.jar
        Stripping debug info in ./jre/lib/jsse.jar
INFO: Stripping debug info in object files...strip: bin/java-rmi.cgi: file format not recognized
done
INFO: Removing all .debuginfo files...done
INFO: Removing all src.zip files...done
INFO: Trimming bin dir.../usr/local/bin/slim-java.sh: line 280: /usr/local/bin/slim-java_lib_del.list: No such file or directory
INFO: Trimming bin dir.../usr/local/bin/slim-java.sh: line 269: /usr/local/bin/slim-java_bin_del.list: No such file or directory
Done
+ apk del --purge .build-deps
WARNING: Ignoring APKINDEX.2c4ac24e.tar.gz: No such file or directory
WARNING: Ignoring APKINDEX.40a3604f.tar.gz: No such file or directory
(1/7) Purging .build-deps (20201218.171358)
(2/7) Purging bash (5.0.17-r0)
Executing bash-5.0.17-r0.pre-deinstall
(3/7) Purging binutils (2.34-r1)
(4/7) Purging readline (8.0.4-r0)
(5/7) Purging ncurses-libs (6.2_p20200523-r0)
(6/7) Purging ncurses-terminfo-base (6.2_p20200523-r0)
(7/7) Purging libstdc++ (9.3.0-r2)
Executing busybox-1.31.1-r19.trigger
Executing glibc-bin-2.31-r0.trigger
/usr/glibc-compat/sbin/ldconfig: /usr/glibc-compat/lib/ld-linux-x86-64.so.2 is not a symbolic link

OK: 18 MiB in 22 packages
+ rm -rf '/var/cache/apk/*'
+ apk del --purge .fetch-deps
WARNING: Ignoring APKINDEX.2c4ac24e.tar.gz: No such file or directory
WARNING: Ignoring APKINDEX.40a3604f.tar.gz: No such file or directory
(1/5) Purging .fetch-deps (20201218.170920)
(2/5) Purging curl (7.69.1-r3)
(3/5) Purging libcurl (7.69.1-r3)
(4/5) Purging ca-certificates (20191127-r4)
Executing ca-certificates-20191127-r4.post-deinstall
(5/5) Purging nghttp2-libs (1.41.0-r0)
Executing busybox-1.31.1-r19.trigger
Executing glibc-bin-2.31-r0.trigger
/usr/glibc-compat/sbin/ldconfig: /usr/glibc-compat/lib/ld-linux-x86-64.so.2 is not a symbolic link

OK: 17 MiB in 17 packages
+ rm -rf '/var/cache/apk/*'
+ rm -rf /tmp/openjdk.tar.gz
Removing intermediate container fd5bd150123b
 ---> 70588d816682
Step 7/9 : ENV JAVA_HOME=/opt/java/openjdk     PATH="/opt/java/openjdk/bin:$PATH"
 ---> Running in 21c1830e5f48
Removing intermediate container 21c1830e5f48
 ---> d8adafedfe71
Step 8/9 : ENV JAVA_TOOL_OPTIONS="-XX:+IgnoreUnrecognizedVMOptions -XX:+IdleTuningGcOnIdle -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,readonly,nonFatal"
 ---> Running in f713f171aab8
Removing intermediate container f713f171aab8
 ---> 92dab9049495
Step 9/9 : RUN set -eux;     apk add --no-cache --virtual .scc-deps curl;     unset OPENJ9_JAVA_OPTIONS;     SCC_SIZE="50m";     SCC_GEN_RUNS_COUNT=2;     DOWNLOAD_PATH_TOMCAT=/tmp/tomcat;     INSTALL_PATH_TOMCAT=/opt/tomcat-home;     TOMCAT_CHECKSUM="0db27185d9fc3174f2c670f814df3dda8a008b89d1a38a5d96cbbe119767ebfb1cf0bce956b27954aee9be19c4a7b91f2579d967932207976322033a86075f98";     TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz";         mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}";     curl -LfsSo "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}";     echo "${TOMCAT_CHECKSUM} *${DOWNLOAD_PATH_TOMCAT}/tomcat.tar.gz" | sha512sum -c -;     tar -xf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1;     rm -rf "${DOWNLOAD_PATH_TOMCAT}";         java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version;     export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal";     for i in $(seq 0 $SCC_GEN_RUNS_COUNT);     do         "${INSTALL_PATH_TOMCAT}"/bin/startup.sh;         sleep 5;         kill -9 $(ps -ef | grep 'catalina' | tr -s ' ' | cut -d ' ' -f 2 | head -n 2 | tail -n 1);         sleep 5;     done;         FULL=$( (java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,printallStats 2>&1 || true) | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}');     DST_CACHE=$(java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy 2>&1 || true);     SCC_SIZE=$(echo $SCC_SIZE | sed 's/.$//');     SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}");     [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1;     SCC_SIZE="${SCC_SIZE}m";     java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version;     unset OPENJ9_JAVA_OPTIONS;         export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal";     for i in $(seq 0 $SCC_GEN_RUNS_COUNT);     do         "${INSTALL_PATH_TOMCAT}"/bin/startup.sh;         sleep 5;         kill -9 $(ps -ef | grep 'catalina' | tr -s ' ' | cut -d ' ' -f 2 | head -n 2 | tail -n 1);         sleep 5;     done;         FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats 2>&1 || true) | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}');     echo "SCC layer is $FULL% full.";     rm -rf "${INSTALL_PATH_TOMCAT}";     if [ -d "/opt/java/.scc" ]; then           chmod -R 0777 /opt/java/.scc;     fi;         apk del --purge .scc-deps;     rm -rf /var/cache/apk/*;     echo "SCC generation phase completed";
 ---> Running in b1fce469b993
+ apk add --no-cache --virtual .scc-deps curl
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/x86_64/APKINDEX.tar.gz
(1/5) Installing ca-certificates (20191127-r4)
(2/5) Installing nghttp2-libs (1.41.0-r0)
(3/5) Installing libcurl (7.69.1-r3)
(4/5) Installing curl (7.69.1-r3)
(5/5) Installing .scc-deps (20201218.171614)
Executing busybox-1.31.1-r19.trigger
Executing ca-certificates-20191127-r4.trigger
Executing glibc-bin-2.31-r0.trigger
/usr/glibc-compat/sbin/ldconfig: /usr/glibc-compat/lib/ld-linux-x86-64.so.2 is not a symbolic link

OK: 18 MiB in 22 packages
+ unset OPENJ9_JAVA_OPTIONS
+ SCC_SIZE=50m
+ SCC_GEN_RUNS_COUNT=2
+ DOWNLOAD_PATH_TOMCAT=/tmp/tomcat
+ INSTALL_PATH_TOMCAT=/opt/tomcat-home
+ TOMCAT_CHECKSUM=0db27185d9fc3174f2c670f814df3dda8a008b89d1a38a5d96cbbe119767ebfb1cf0bce956b27954aee9be19c4a7b91f2579d967932207976322033a86075f98
+ TOMCAT_DWNLD_URL=https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz
+ mkdir -p /tmp/tomcat /opt/tomcat-home
+ curl -LfsSo /tmp/tomcat/tomcat.tar.gz https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz
+ echo '0db27185d9fc3174f2c670f814df3dda8a008b89d1a38a5d96cbbe119767ebfb1cf0bce956b27954aee9be19c4a7b91f2579d967932207976322033a86075f98 */tmp/tomcat/tomcat.tar.gz'
+ sha512sum -c -
/tmp/tomcat/tomcat.tar.gz: OK
+ tar -xf /tmp/tomcat/tomcat.tar.gz -C /opt/tomcat-home '--strip-components=1'
+ rm -rf /tmp/tomcat
+ java '-Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer' -Xscmx50m -version
openjdk version "1.8.0_275"
OpenJDK Runtime Environment (build 1.8.0_275-b01)
Eclipse OpenJ9 VM (build openj9-0.23.0, JRE 1.8.0 Linux amd64-64-Bit Compressed References 20201110_845 (JIT enabled, AOT enabled)
OpenJ9   - 0394ef754
OMR      - 582366ae5
JCL      - b52d2ff7ee based on jdk8u275-b01)
+ export 'OPENJ9_JAVA_OPTIONS=-Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal'
+ seq 0 2
+ /opt/tomcat-home/bin/startup.sh
Tomcat started.
+ sleep 5
+ ps -ef
+ grep catalina+ 
tr -s ' '
+ tail -n 1
+ cut -d ' ' -f 2
+ head -n 2
+ kill -9 52
+ sleep 5
+ /opt/tomcat-home/bin/startup.sh
Tomcat started.
+ sleep 5
+ ps -ef
+ grep catalina
+ tr -s ' '
+ cut -d ' ' -f 2
+ tail -n 1
+ head -n 2
+ kill -9 109
+ sleep 5
+ /opt/tomcat-home/bin/startup.sh
Tomcat started.
+ sleep 5
+ ps -ef
+ grep catalina
+ cut -d ' ' -f 2
+ tr -s ' '
+ tail+  -n 1head
 -n 2
+ kill -9 166
+ sleep 5
+ java '-Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,printallStats'
+ awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}'
+ true
+ FULL=27
+ java '-Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy'
+ true
+ DST_CACHE='JVMSHRC806I Compressed references persistent shared cache "dry_run_scc" has been destroyed. Use option -Xnocompressedrefs if you want to destroy a non-compressed references cache.'
+ echo 50m
+ sed 's/.$//'
+ SCC_SIZE=50
+ awk 'BEGIN {print int(50 * 27 / 100.0)}'
+ SCC_SIZE=13
+ '[' 13 -eq 0 ]
+ SCC_SIZE=13m
+ java '-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer' -Xscmx13m -version
openjdk version "1.8.0_275"
OpenJDK Runtime Environment (build 1.8.0_275-b01)
Eclipse OpenJ9 VM (build openj9-0.23.0, JRE 1.8.0 Linux amd64-64-Bit Compressed References 20201110_845 (JIT enabled, AOT enabled)
OpenJ9   - 0394ef754
OMR      - 582366ae5
JCL      - b52d2ff7ee based on jdk8u275-b01)
+ unset OPENJ9_JAVA_OPTIONS
+ export 'OPENJ9_JAVA_OPTIONS=-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal'
+ seq 0 2
+ /opt/tomcat-home/bin/startup.sh
Tomcat started.
+ sleep 5
+ + psgrep catalina -ef

+ head -n 2
+ tail -n 1
+ tr -s ' '
+ cut -d ' ' -f 2
+ kill -9 275
+ sleep 5
+ /opt/tomcat-home/bin/startup.sh
Tomcat started.
+ sleep 5
+ ps -ef
+ grep catalina
+ tr -s ' '
+ cut -d ' ' -f 2
+ + tail -nhead 1
 -n 2
+ kill -9 332
+ sleep 5
+ /opt/tomcat-home/bin/startup.sh
Tomcat started.
+ sleep 5
+ ps -ef
+ grep catalina
+ tr -s ' '
+ head -n 2+ cut -d ' ' -f 2

+ tail -n 1
+ kill -9 389
+ sleep 5
+ java '-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats'
+ awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}'
+ true
+ FULL=80
+ echo 'SCC layer is 80% full.'
SCC layer is 80% full.
+ rm -rf /opt/tomcat-home
+ '[' -d /opt/java/.scc ]
+ chmod -R 0777 /opt/java/.scc
+ apk del --purge .scc-deps
WARNING: Ignoring APKINDEX.2c4ac24e.tar.gz: No such file or directory
WARNING: Ignoring APKINDEX.40a3604f.tar.gz: No such file or directory
(1/5) Purging .scc-deps (20201218.171614)
(2/5) Purging curl (7.69.1-r3)
(3/5) Purging libcurl (7.69.1-r3)
(4/5) Purging ca-certificates (20191127-r4)
Executing ca-certificates-20191127-r4.post-deinstall
(5/5) Purging nghttp2-libs (1.41.0-r0)
Executing busybox-1.31.1-r19.trigger
Executing glibc-bin-2.31-r0.trigger
/usr/glibc-compat/sbin/ldconfig: /usr/glibc-compat/lib/ld-linux-x86-64.so.2 is not a symbolic link

OK: 17 MiB in 17 packages
+ rm -rf '/var/cache/apk/*'
+ echo 'SCC generation phase completed'
SCC generation phase completed
Removing intermediate container b1fce469b993
 ---> 853e024e2d29
Successfully built 853e024e2d29
Successfully tagged alpine-scc-test:latest

And SCC (ShareClassCache) is generated as well.

[bharathappali@oc7788374886 openjdk-docker]$ docker run --rm -it alpine-scc-test /bin/sh
/ # ls -lh /opt/java/.scc/C290M4F1A64P_openj9_system_scc_G41L00 
-rwxrwxrwx    1 root     root       13.0M Dec 18 17:18 /opt/java/.scc/C290M4F1A64P_openj9_system_scc_G41L00

The command

FULL=$( (java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,printallStats 2>&1 || true) | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}')

is getting the result correctly to right size the SCC (ShareClassCache) in the docker image generation

@bharathappali
Copy link
Collaborator

Correct me if I'm wrong, I feel you are executing the command in a container instance of the image generated. The cache dry_run_scc is only used to get the exact size of SCC, so once we get the size of cache generated we destroy the cache and create a new one with name openj9_system_scc. You can try this inside the container instance of the image generated and check if its resulting the percentage of cache filled

echo $( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats 2>&1 || true) | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}')

@blueapple168
Copy link
Author

blueapple168 commented Dec 19, 2020

But I can't do it well.

image

Cloning into '.'...
Warning: Permanently added the RSA host key for IP address '140.82.114.4' to the list of known hosts.
Reset branch 'master'
Your branch is up-to-date with 'origin/master'.
KernelVersion: 4.4.0-1060-aws
Components: [{u'Version': u'19.03.8', u'Name': u'Engine', u'Details': {u'KernelVersion': u'4.4.0-1060-aws', u'Os': u'linux', u'BuildTime': u'2020-03-11T01:24:30.000000000+00:00', u'ApiVersion': u'1.40', u'MinAPIVersion': u'1.12', u'GitCommit': u'afacb8b7f0', u'Arch': u'amd64', u'Experimental': u'false', u'GoVersion': u'go1.12.17'}}, {u'Version': u'1.2.13', u'Name': u'containerd', u'Details': {u'GitCommit': u'7ad184331fa3e55e52b890ea95e65ba581ae3429'}}, {u'Version': u'1.0.0-rc10', u'Name': u'runc', u'Details': {u'GitCommit': u'dc9208a3303feef5b3839f4323d9beb36df0a9dd'}}, {u'Version': u'0.18.0', u'Name': u'docker-init', u'Details': {u'GitCommit': u'fec3683'}}]
Arch: amd64
BuildTime: 2020-03-11T01:24:30.000000000+00:00
ApiVersion: 1.40
Platform: {u'Name': u'Docker Engine - Community'}
Version: 19.03.8
MinAPIVersion: 1.12
GitCommit: afacb8b7f0
Os: linux
GoVersion: go1.12.17
Starting build of index.docker.io/blueapple/baseimage:jdk8u275-b01_openj9-0.23.0-alpine-orign...
Step 1/11 : ARG IMAGE_VERSION=3.12
Step 2/11 : FROM alpine:$IMAGE_VERSION AS baseimage
---> 389fef711851
Step 3/11 : ENV LANG='zh_CN.UTF-8' LANGUAGE='zh_CN:zh' LC_ALL='zh_CN.UTF-8'
---> Running in 431eae955b02
Removing intermediate container 431eae955b02
---> 3d8e2b090b59
Step 4/11 : RUN apk add --no-cache tzdata --virtual .build-deps curl binutils zstd && GLIBC_VER="2.31-r0" && ALPINE_GLIBC_REPO="https://github.com/sgerrand/alpine-pkg-glibc/releases/download" && GCC_LIBS_URL="https://archive.archlinux.org/packages/g/gcc-libs/gcc-libs-10.1.0-2-x86_64.pkg.tar.zst" && GCC_LIBS_SHA256="f80320a03ff73e82271064e4f684cd58d7dbdb07aa06a2c4eea8e0f3c507c45c" && ZLIB_URL="https://archive.archlinux.org/packages/z/zlib/zlib-1%3A1.2.11-3-x86_64.pkg.tar.xz" && ZLIB_SHA256=17aede0b9f8baa789c5aa3f358fbf8c68a5f1228c5e6cba1a5dd34102ef4d4e5 && curl -LfsS https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub -o /etc/apk/keys/sgerrand.rsa.pub && SGERRAND_RSA_SHA256="823b54589c93b02497f1ba4dc622eaef9c813e6b0f0ebbb2f771e32adf9f4ef2" && echo "${SGERRAND_RSA_SHA256} */etc/apk/keys/sgerrand.rsa.pub" | sha256sum -c - && curl -LfsS ${ALPINE_GLIBC_REPO}/${GLIBC_VER}/glibc-${GLIBC_VER}.apk > /tmp/glibc-${GLIBC_VER}.apk && apk add --no-cache /tmp/glibc-${GLIBC_VER}.apk && curl -LfsS ${ALPINE_GLIBC_REPO}/${GLIBC_VER}/glibc-bin-${GLIBC_VER}.apk > /tmp/glibc-bin-${GLIBC_VER}.apk && apk add --no-cache /tmp/glibc-bin-${GLIBC_VER}.apk && curl -Ls ${ALPINE_GLIBC_REPO}/${GLIBC_VER}/glibc-i18n-${GLIBC_VER}.apk > /tmp/glibc-i18n-${GLIBC_VER}.apk && apk add --no-cache /tmp/glibc-i18n-${GLIBC_VER}.apk && /usr/glibc-compat/bin/localedef --force --inputfile POSIX --charmap UTF-8 "$LANG" || true && echo "export LANG=$LANG" > /etc/profile.d/locale.sh && curl -LfsS ${GCC_LIBS_URL} -o /tmp/gcc-libs.tar.zst && echo "${GCC_LIBS_SHA256} */tmp/gcc-libs.tar.zst" | sha256sum -c - && mkdir /tmp/gcc && zstd -d /tmp/gcc-libs.tar.zst --output-dir-flat /tmp && tar -xf /tmp/gcc-libs.tar -C /tmp/gcc && mv /tmp/gcc/usr/lib/libgcc* /tmp/gcc/usr/lib/libstdc++* /usr/glibc-compat/lib && strip /usr/glibc-compat/lib/libgcc_s.so.* /usr/glibc-compat/lib/libstdc++.so* && curl -LfsS ${ZLIB_URL} -o /tmp/libz.tar.xz && echo "${ZLIB_SHA256} */tmp/libz.tar.xz" | sha256sum -c - && mkdir /tmp/libz && tar -xf /tmp/libz.tar.xz -C /tmp/libz && mv /tmp/libz/usr/lib/libz.so* /usr/glibc-compat/lib && apk del --purge .build-deps glibc-i18n && rm -rf /tmp/*.apk /tmp/gcc /tmp/gcc-libs.tar* /tmp/libz /tmp/libz.tar.xz /var/cache/apk/*
---> Running in f7f0d7744644
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/x86_64/APKINDEX.tar.gz
(1/10) Installing tzdata (2020c-r1)
(2/10) Installing ca-certificates (20191127-r4)
(3/10) Installing nghttp2-libs (1.41.0-r0)
(4/10) Installing libcurl (7.69.1-r3)
(5/10) Installing curl (7.69.1-r3)
(6/10) Installing libgcc (9.3.0-r2)
(7/10) Installing libstdc++ (9.3.0-r2)
(8/10) Installing binutils (2.34-r1)
(9/10) Installing zstd (1.4.5-r0)
(10/10) Installing .build-deps (20201219.030637)
Executing busybox-1.31.1-r19.trigger
Executing ca-certificates-20191127-r4.trigger
OK: 22 MiB in 24 packages
/etc/apk/keys/sgerrand.rsa.pub: OK
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/x86_64/APKINDEX.tar.gz
(1/1) Installing glibc (2.31-r0)
OK: 31 MiB in 25 packages
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/x86_64/APKINDEX.tar.gz
(1/1) Installing glibc-bin (2.31-r0)
Executing glibc-bin-2.31-r0.trigger
�[91m/usr/glibc-compat/sbin/ldconfig: /usr/glibc-compat/lib/ld-linux-x86-64.so.2 is not a symbolic link
�[0m
OK: 33 MiB in 26 packages
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/x86_64/APKINDEX.tar.gz
(1/1) Installing glibc-i18n (2.31-r0)
OK: 59 MiB in 27 packages
�[91mfailed to set locale!
[warning] No definition for LC_PAPER category found
failed to set locale!
[warning] No definition for LC_NAME category found
failed to set locale!
[warning] No definition for LC_ADDRESS category found
failed to set locale!
[warning] No definition for LC_TELEPHONE category found
failed to set locale!
[warning] No definition for LC_MEASUREMENT category found
failed to set locale!
[warning] No definition for LC_IDENTIFICATION category found
�[0m
/tmp/gcc-libs.tar.zst: OK
�[91m tmp/gcc-libs.tar.zst : 0 MB... �[0m
�[91m tmp/gcc-libs.tar.zst : 37 MB... �[0m
�[91m tmp/gcc-libs.tar.zst : 71 MB... �[0m
�[91m tmp/gcc-libs.tar.zst : 111 MB... �[0m
�[91m tmp/gcc-libs.tar.zst : 146 MB... �[0m
�[91m �[0m
�[91m/tmp/gcc-libs.tar.zst: 156098560 bytes
�[0m
/tmp/libz.tar.xz: OK
�[91mWARNING: �[0m
�[91mIgnoring APKINDEX.2c4ac24e.tar.gz: No such file or directory�[0m
�[91m
�[0m
�[91mWARNING: �[0m
�[91mIgnoring APKINDEX.40a3604f.tar.gz: No such file or directory�[0m
�[91m
�[0m
(1/10) Purging .build-deps (20201219.030637)
(2/10) Purging tzdata (2020c-r1)
(3/10) Purging curl (7.69.1-r3)
(4/10) Purging binutils (2.34-r1)
(5/10) Purging zstd (1.4.5-r0)
(6/10) Purging glibc-i18n (2.31-r0)
(7/10) Purging libcurl (7.69.1-r3)
(8/10) Purging ca-certificates (20191127-r4)
Executing ca-certificates-20191127-r4.post-deinstall
(9/10) Purging nghttp2-libs (1.41.0-r0)
(10/10) Purging libstdc++ (9.3.0-r2)
Executing busybox-1.31.1-r19.trigger
Executing glibc-bin-2.31-r0.trigger
�[91m/usr/glibc-compat/sbin/ldconfig: �[0m
�[91m/usr/glibc-compat/lib/ld-linux-x86-64.so.2 is not a symbolic link
�[0m
�[91m
�[0m
OK: 17 MiB in 17 packages
Removing intermediate container f7f0d7744644
---> 14975edffbe7
Step 5/11 : ENV JAVA_VERSION jdk8u275-b01_openj9-0.23.0
---> Running in bf00822038ae
Removing intermediate container bf00822038ae
---> c576cab5087f
Step 6/11 : RUN set -eux; apk add --no-cache --virtual .fetch-deps curl; ARCH="$(apk --print-arch)"; case "${ARCH}" in aarch64|arm64) ESUM='0e5a8776fb475269c293bb9acf20665a634d9348c6c061109a5afbbfec70e71b'; BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u275-b01_openj9-0.23.0/OpenJDK8U-jdk_aarch64_linux_openj9_8u275b01_openj9-0.23.0.tar.gz'; ;; ppc64el|ppc64le) ESUM='ddf2a606534dce7f06c91c13b438bb986d42a3ff7a3f5d928d0ecb79a6ba13df'; BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u275-b01_openj9-0.23.0/OpenJDK8U-jdk_ppc64le_linux_openj9_8u275b01_openj9-0.23.0.tar.gz'; ;; s390x) ESUM='92c7c45b4403e900c0f94772f7bce0b085453d9727917e6255fa8a1821499bb1'; BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u275-b01_openj9-0.23.0/OpenJDK8U-jdk_s390x_linux_openj9_8u275b01_openj9-0.23.0.tar.gz'; ;; amd64|x86_64) ESUM='8bb74ff7ab2f64ced23212ee0520295c01b6f2d7558fd6e488a8ca795ced1ebd'; BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u275-b01_openj9-0.23.0/OpenJDK8U-jdk_x64_linux_openj9_8u275b01_openj9-0.23.0.tar.gz'; ;; *) echo "Unsupported arch: ${ARCH}"; exit 1; ;; esac; curl -LfsSo /tmp/openjdk.tar.gz ${BINARY_URL}; echo "${ESUM} */tmp/openjdk.tar.gz" | sha256sum -c -; mkdir -p /opt/java/openjdk; cd /opt/java/openjdk; tar -xf /tmp/openjdk.tar.gz --strip-components=1; apk del --purge .fetch-deps; rm -rf /var/cache/apk/*; rm -rf /tmp/openjdk.tar.gz;
---> Running in 3f29bd7c7815
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz
�[91m+ apk add --no-cache --virtual .fetch-deps curl
�[0m
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/x86_64/APKINDEX.tar.gz
(1/5) Installing ca-certificates (20191127-r4)
(2/5) Installing nghttp2-libs (1.41.0-r0)
(3/5) Installing libcurl (7.69.1-r3)
(4/5) Installing curl (7.69.1-r3)
(5/5) Installing .fetch-deps (20201219.030649)
Executing busybox-1.31.1-r19.trigger
Executing ca-certificates-20191127-r4.trigger
Executing glibc-bin-2.31-r0.trigger
�[91m/usr/glibc-compat/sbin/ldconfig: /usr/glibc-compat/lib/ld-linux-x86-64.so.2 is not a symbolic link
�[0m
OK: 18 MiB in 22 packages
�[91m+ apk --print-arch
�[0m
�[91m+ ARCH=x86_64
+ ESUM=8bb74ff7ab2f64ced23212ee0520295c01b6f2d7558fd6e488a8ca795ced1ebd
+ BINARY_URL=https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u275-b01_openj9-0.23.0/OpenJDK8U-jdk_x64_linux_openj9_8u275b01_openj9-0.23.0.tar.gz
+ curl -LfsSo /tmp/openjdk.tar.gz https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u275-b01_openj9-0.23.0/OpenJDK8U-jdk_x64_linux_openj9_8u275b01_openj9-0.23.0.tar.gz
�[0m
�[91m+ sha256sum -c -
�[0m
�[91m+ echo '8bb74ff7ab2f64ced23212ee0520295c01b6f2d7558fd6e488a8ca795ced1ebd */tmp/openjdk.tar.gz'
�[0m
/tmp/openjdk.tar.gz: OK
�[91m+ mkdir -p /opt/java/openjdk
�[0m
�[91m+ cd /opt/java/openjdk
�[0m
�[91m+ tar -xf /tmp/openjdk.tar.gz '--strip-components=1'
�[0m
�[91m+ apk del --purge .fetch-deps
�[0m
�[91mWARNING: Ignoring APKINDEX.2c4ac24e.tar.gz: No such file or directory
WARNING: Ignoring APKINDEX.40a3604f.tar.gz: No such file or directory
�[0m
(1/5) Purging .fetch-deps (20201219.030649)
(2/5) Purging curl (7.69.1-r3)
(3/5) Purging libcurl (7.69.1-r3)
(4/5) Purging ca-certificates (20191127-r4)
Executing ca-certificates-20191127-r4.post-deinstall
(5/5) Purging nghttp2-libs (1.41.0-r0)
Executing busybox-1.31.1-r19.trigger
Executing glibc-bin-2.31-r0.trigger
�[91m/usr/glibc-compat/sbin/ldconfig: /usr/glibc-compat/lib/ld-linux-x86-64.so.2 is not a symbolic link
�[0m
�[91m+ rm -rf '/var/cache/apk/*'
�[0m
OK: 17 MiB in 17 packages
�[91m+ rm -rf /tmp/openjdk.tar.gz
�[0m
Removing intermediate container 3f29bd7c7815
---> 948543cc3508
Step 7/11 : ENV JAVA_HOME=/opt/java/openjdk PATH="/opt/java/openjdk/bin:$PATH"
---> Running in e2a97fe565c7
Removing intermediate container e2a97fe565c7
---> 92046de056c4
Step 8/11 : ENV JAVA_TOOL_OPTIONS="-XX:+IgnoreUnrecognizedVMOptions -XX:+IdleTuningGcOnIdle -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,readonly,nonFatal"
---> Running in 36573812ae6e
Removing intermediate container 36573812ae6e
---> 90284e0b49c1
Step 9/11 : RUN set -eux; apk add --no-cache --virtual .scc-deps curl; unset OPENJ9_JAVA_OPTIONS; SCC_SIZE="50m"; SCC_GEN_RUNS_COUNT=2; DOWNLOAD_PATH_TOMCAT=/tmp/tomcat; INSTALL_PATH_TOMCAT=/opt/tomcat-home; TOMCAT_CHECKSUM="0db27185d9fc3174f2c670f814df3dda8a008b89d1a38a5d96cbbe119767ebfb1cf0bce956b27954aee9be19c4a7b91f2579d967932207976322033a86075f98"; TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz"; mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}"; curl -LfsSo "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; echo "${TOMCAT_CHECKSUM} *${DOWNLOAD_PATH_TOMCAT}/tomcat.tar.gz" | sha512sum -c -; tar -xf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1; rm -rf "${DOWNLOAD_PATH_TOMCAT}"; java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version; export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal"; for i in $(seq 0 $SCC_GEN_RUNS_COUNT); do "${INSTALL_PATH_TOMCAT}"/bin/startup.sh; sleep 5; kill -9 $(ps -ef | grep 'catalina' | tr -s ' ' | cut -d ' ' -f 2 | head -n 2 | tail -n 1); sleep 5; done; FULL=$( (java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,printallStats 2>&1 || true) | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}'); DST_CACHE=$(java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy 2>&1 || true); SCC_SIZE=$(echo $SCC_SIZE | sed 's/.$//'); SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}"); [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1; SCC_SIZE="${SCC_SIZE}m"; java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version; unset OPENJ9_JAVA_OPTIONS; export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal"; for i in $(seq 0 $SCC_GEN_RUNS_COUNT); do "${INSTALL_PATH_TOMCAT}"/bin/startup.sh; sleep 5; kill -9 $(ps -ef | grep 'catalina' | tr -s ' ' | cut -d ' ' -f 2 | head -n 2 | tail -n 1); sleep 5; done; FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats 2>&1 || true) | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}'); echo "SCC layer is $FULL% full."; rm -rf "${INSTALL_PATH_TOMCAT}"; if [ -d "/opt/java/.scc" ]; then chmod -R 0777 /opt/java/.scc; fi; apk del --purge .scc-deps; rm -rf /var/cache/apk/*; echo "SCC generation phase completed"; apk add --no-cache curl tzdata bash bash-completion vim ttf-dejavu busybox-extras mkfontscale mkfontdir fontconfig coreutils dumb-init; cp -r -f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime; echo "Asia/Shanghai" > /etc/timezone; apk del tzdata zst; rm -rf /tmp/*.apk /tmp/gcc /tmp/gcc-libs.tar* /tmp/libz /tmp/libz.tar.xz /var/cache/apk/*; echo ' PS1='\''\[\e[01;33m\][\h \u:\[\e[01;34m\]\w\[\e[01;33m\]]\[\e[00m\]\$ '\'' ; eval `dircolors -b` ; alias ls="ls --color=auto" ; alias l="ls -lah" ; alias ll="ls -lh" ; alias l.="ls -d .* --color=auto" ; alias mv="mv -i" ; alias rm="rm -i" ; export PATH='"${PATH}"' ' >> /etc/profile; echo '. ~/.bashrc' > /root/.bash_profile; echo '. /etc/profile' > /root/.bashrc
---> Running in e3ca08bad057
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz
�[91m+ apk add --no-cache --virtual .scc-deps curl
�[0m
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/x86_64/APKINDEX.tar.gz
(1/5) Installing ca-certificates (20191127-r4)
(2/5) Installing nghttp2-libs (1.41.0-r0)
(3/5) Installing libcurl (7.69.1-r3)
(4/5) Installing curl (7.69.1-r3)
(5/5) Installing .scc-deps (20201219.030701)
Executing busybox-1.31.1-r19.trigger
Executing ca-certificates-20191127-r4.trigger
Executing glibc-bin-2.31-r0.trigger
�[91m/usr/glibc-compat/sbin/ldconfig: /usr/glibc-compat/lib/ld-linux-x86-64.so.2 is not a symbolic link
�[0m
OK: 18 MiB in 22 packages
�[91m+ unset�[0m
�[91m OPENJ9_JAVA_OPTIONS
�[0m
�[91m+ �[0m
�[91mSCC_SIZE=50m
�[0m
�[91m+ SCC_GEN_RUNS_COUNT=2�[0m
�[91m
+ �[0m
�[91mDOWNLOAD_PATH_TOMCAT=/tmp/tomcat�[0m
�[91m
�[0m
�[91m+ �[0m
�[91mINSTALL_PATH_TOMCAT=/opt/tomcat-home�[0m
�[91m
�[0m
�[91m+ �[0m
�[91mTOMCAT_CHECKSUM=0db27185d9fc3174f2c670f814df3dda8a008b89d1a38a5d96cbbe119767ebfb1cf0bce956b27954aee9be19c4a7b91f2579d967932207976322033a86075f98�[0m
�[91m
�[0m
�[91m+ �[0m
�[91mTOMCAT_DWNLD_URL=https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz�[0m
�[91m
�[0m
�[91m+ �[0m
�[91mmkdir�[0m
�[91m -p�[0m
�[91m /tmp/tomcat�[0m
�[91m /opt/tomcat-home�[0m
�[91m
�[0m
�[91m+ �[0m
�[91mcurl�[0m
�[91m -LfsSo�[0m
�[91m /tmp/tomcat/tomcat.tar.gz�[0m
�[91m https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz
�[0m
�[91m+ �[0m
�[91msha512sum -c -�[0m
�[91m
�[0m
�[91m+ �[0m
�[91mecho�[0m
�[91m '0db27185d9fc3174f2c670f814df3dda8a008b89d1a38a5d96cbbe119767ebfb1cf0bce956b27954aee9be19c4a7b91f2579d967932207976322033a86075f98 */tmp/tomcat/tomcat.tar.gz'�[0m
�[91m
�[0m
/tmp/tomcat/tomcat.tar.gz: OK
�[91m+ �[0m
�[91mtar�[0m
�[91m -xf�[0m
�[91m /tmp/tomcat/tomcat.tar.gz�[0m
�[91m -C�[0m
�[91m /opt/tomcat-home�[0m
�[91m '--strip-components=1'�[0m
�[91m
�[0m
�[91m+ �[0m
�[91mrm -rf /tmp/tomcat�[0m
�[91m
�[0m
�[91m+ �[0m
�[91mjava '-Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer' -Xscmx50m�[0m
�[91m -version�[0m
�[91m
�[0m
�[91mopenjdk version "1.8.0_275"�[0m
�[91m
�[0m
�[91mOpenJDK Runtime Environment (build 1.8.0_275-b01�[0m
�[91m)�[0m
�[91m
�[0m
�[91mEclipse OpenJ9 VM (build openj9-0.23.0, JRE 1.8.0 Linux amd64-64-Bit Compressed References 20201110_845 (JIT enabled, AOT enabled)
OpenJ9 - 0394ef754
OMR - 582366ae5
JCL - b52d2ff7ee based on jdk8u275-b01)�[0m
�[91m
�[0m
�[91m+ export�[0m
�[91m 'OPENJ9_JAVA_OPTIONS=-Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal'
�[0m
�[91m+ �[0m
�[91mseq�[0m
�[91m 0�[0m
�[91m 2�[0m
�[91m
�[0m
�[91m+ �[0m
�[91m/opt/tomcat-home/bin/startup.sh
�[0m
Tomcat started.
�[91m+ �[0m
�[91msleep�[0m
�[91m 5�[0m
�[91m
�[0m
�[91m+ �[0m
�[91m+ tail -n 1
head -n 2
�[0m
�[91m+ �[0m
�[91mcut -d ' ' -f 2
�[0m
�[91m+ �[0m
�[91mtr -s ' '�[0m
�[91m
�[0m
�[91m+ grep catalina
+ ps -ef
�[0m
�[91m+ kill -9 52
+ sleep 5
�[0m
�[91m+ /opt/tomcat-home/bin/startup.sh
�[0m
Tomcat started.
�[91m+ sleep 5
�[0m
�[91m+ tail -n 1
+ head -n 2
+ cut -d ' ' -f 2
+ tr -s ' '
+ grep catalina
+ ps -ef
�[0m
�[91m+ kill -9 92
+ sleep 5
�[0m
�[91m+ /opt/tomcat-home/bin/startup.sh
+ sleep 5
�[0m
Tomcat started.
�[91m+ tail -n 1
+ head -n 2
+ cut -d ' ' -f 2
+ tr -s ' '
+ grep catalina
+ ps -ef
�[0m
�[91m+ kill -9 133
+ sleep 5
�[0m
�[91m+ awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}'
+ java '-Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,printallStats'
�[0m
�[91m+ true
�[0m
�[91m+ FULL=
�[0m
�[91m+ java '-Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy'
�[0m
�[91m+ true
�[0m
�[91m+ DST_CACHE='JVMSHRC806I 已销毁压缩的引用持久共享高速缓存“dry_run_scc”。如果要销毁非压缩的引用高速缓存,请使用选项 -Xnocompressedrefs。'
�[0m
�[91m+ sed 's/.$//'
�[0m
�[91m+ echo 50m
�[0m
�[91m+ SCC_SIZE=50
�[0m
�[91m+ awk 'BEGIN {print int(50 * / 100.0)}'
�[0m
�[91mawk: cmd. line:1: Unexpected end of string
�[0m
�[91m+ SCC_SIZE=
�[0m
Removing intermediate container e3ca08bad057
The command '/bin/sh -c set -eux; apk add --no-cache --virtual .scc-deps curl; unset OPENJ9_JAVA_OPTIONS; SCC_SIZE="50m"; SCC_GEN_RUNS_COUNT=2; DOWNLOAD_PATH_TOMCAT=/tmp/tomcat; INSTALL_PATH_TOMCAT=/opt/tomcat-home; TOMCAT_CHECKSUM="0db27185d9fc3174f2c670f814df3dda8a008b89d1a38a5d96cbbe119767ebfb1cf0bce956b27954aee9be19c4a7b91f2579d967932207976322033a86075f98"; TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz"; mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}"; curl -LfsSo "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; echo "${TOMCAT_CHECKSUM} *${DOWNLOAD_PATH_TOMCAT}/tomcat.tar.gz" | sha512sum -c -; tar -xf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1; rm -rf "${DOWNLOAD_PATH_TOMCAT}"; java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version; export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal"; for i in $(seq 0 $SCC_GEN_RUNS_COUNT); do "${INSTALL_PATH_TOMCAT}"/bin/startup.sh; sleep 5; kill -9 $(ps -ef | grep 'catalina' | tr -s ' ' | cut -d ' ' -f 2 | head -n 2 | tail -n 1); sleep 5; done; FULL=$( (java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,printallStats 2>&1 || true) | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}'); DST_CACHE=$(java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy 2>&1 || true); SCC_SIZE=$(echo $SCC_SIZE | sed 's/.$//'); SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}"); [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1; SCC_SIZE="${SCC_SIZE}m"; java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version; unset OPENJ9_JAVA_OPTIONS; export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal"; for i in $(seq 0 $SCC_GEN_RUNS_COUNT); do "${INSTALL_PATH_TOMCAT}"/bin/startup.sh; sleep 5; kill -9 $(ps -ef | grep 'catalina' | tr -s ' ' | cut -d ' ' -f 2 | head -n 2 | tail -n 1); sleep 5; done; FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats 2>&1 || true) | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}'); echo "SCC layer is $FULL% full."; rm -rf "${INSTALL_PATH_TOMCAT}"; if [ -d "/opt/java/.scc" ]; then chmod -R 0777 /opt/java/.scc; fi; apk del --purge .scc-deps; rm -rf /var/cache/apk/*; echo "SCC generation phase completed"; apk add --no-cache curl tzdata bash bash-completion vim ttf-dejavu busybox-extras mkfontscale mkfontdir fontconfig coreutils dumb-init; cp -r -f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime; echo "Asia/Shanghai" > /etc/timezone; apk del tzdata zst; rm -rf /tmp/*.apk /tmp/gcc /tmp/gcc-libs.tar* /tmp/libz /tmp/libz.tar.xz /var/cache/apk/*; echo ' PS1='\''\[\e[01;33m\][\h \u:\[\e[01;34m\]\w\[\e[01;33m\]]\[\e[00m\]\$ '\'' ; eval `dircolors -b` ; alias ls="ls --color=auto" ; alias l="ls -lah" ; alias ll="ls -lh" ; alias l.="ls -d .* --color=auto" ; alias mv="mv -i" ; alias rm="rm -i" ; export PATH='"${PATH}"' ' >> /etc/profile; echo '. ~/.bashrc' > /root/.bash_profile; echo '. /etc/profile' > /root/.bashrc' returned a non-zero code: 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants