From b0e441e32e210d318d7aadc30c3c43baf35b509a Mon Sep 17 00:00:00 2001 From: garyschulte Date: Sun, 19 Mar 2023 16:25:58 -0700 Subject: [PATCH] openj9 docker build (#5217) * openj9 and fix for swt metadata Signed-off-by: garyschulte --------- Signed-off-by: garyschulte Co-authored-by: Sally MacFarlane --- build.gradle | 1 + docker/openj9-jdk-17/Dockerfile | 63 +++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 docker/openj9-jdk-17/Dockerfile diff --git a/build.gradle b/build.gradle index a4dca8ef1d..760d182475 100644 --- a/build.gradle +++ b/build.gradle @@ -652,6 +652,7 @@ def dockerImageName = "${dockerOrgName}/${dockerArtifactName}" def dockerVariants = project.hasProperty("dockerVariants") ? project.getProperty("dockerVariants").split(",") : [ "openjdk-17", "openjdk-17-debug", + "openj9-jdk-17", "graalvm", "openjdk-latest" ] diff --git a/docker/openj9-jdk-17/Dockerfile b/docker/openj9-jdk-17/Dockerfile new file mode 100644 index 0000000000..35c79fc9bd --- /dev/null +++ b/docker/openj9-jdk-17/Dockerfile @@ -0,0 +1,63 @@ +FROM ibm-semeru-runtimes:open-17-jdk-jammy + +ARG VERSION="dev" +RUN apt-get update && \ + apt-get install --no-install-recommends -q --assume-yes curl=7* wget=1.21* jq=1.6* net-tools=1.60* libjemalloc-dev=5.* && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* && \ + adduser --disabled-password --gecos "" --home /opt/besu besu && \ + chown besu:besu /opt/besu && \ + chmod 0755 /opt/besu + +USER besu +WORKDIR /opt/besu + +COPY --chown=besu:besu besu /opt/besu/ + +# Expose services ports +# 5005 JDWP for attaching remote debuggers +# 8545 HTTP JSON-RPC +# 8546 WS JSON-RPC +# 8547 HTTP GraphQL +# 8550 HTTP ENGINE JSON-RPC +# 8551 WS ENGINE JSON-RPC +# 9545 Metrics +# 1098 JMX / JMX-RMI +# 30303 P2P +EXPOSE 5005 8545 8546 8547 8550 8551 9545 1098 30303 + +# defaults for host interfaces +ENV BESU_RPC_HTTP_HOST 0.0.0.0 +ENV BESU_RPC_WS_HOST 0.0.0.0 +ENV BESU_GRAPHQL_HTTP_HOST 0.0.0.0 +ENV BESU_METRICS_HOST 0.0.0.0 +ENV BESU_JMX_HOST 0.0.0.0 +ENV BESU_PID_PATH "/tmp/pid" +ENV BESU_HOST_ALLOWLIST "*" + +#debug options for maximum observability +ENV BESU_LOGGING "INFO" +ENV BESU_RPC_HTTP_API "ETH,NET,TRACE,DEBUG,ADMIN,TXPOOL" +ENV JDWP_OPTS "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005" +ENV JAVA_OPTS "${JDWP_OPTS} " + +ENV OTEL_RESOURCE_ATTRIBUTES="service.name=besu,service.version=$VERSION" + +ENV OLDPATH="${PATH}" +ENV PATH="/opt/besu/bin:${OLDPATH}" + +ENTRYPOINT ["besu"] +HEALTHCHECK --start-period=5s --interval=5s --timeout=1s --retries=10 CMD bash -c "[ -f /tmp/pid ]" + +# Build-time metadata as defined at http://label-schema.org +ARG BUILD_DATE +ARG VCS_REF +LABEL org.label-schema.build-date=$BUILD_DATE \ + org.label-schema.name="Besu" \ + org.label-schema.description="Enterprise Ethereum client" \ + org.label-schema.url="https://besu.hyperledger.org/" \ + org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.vcs-url="https://github.com/hyperledger/besu.git" \ + org.label-schema.vendor="Hyperledger" \ + org.label-schema.version=$VERSION \ + org.label-schema.schema-version="1.0"