Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,9 @@ application {
// run `jcmd <PID> VM.native_memory` to check JVM native memory consumption
"-XX:NativeMemoryTracking=summary",
// 32Mb for Netty Direct ByteBuf
"-Dio.netty.maxDirectMemory=33554432"
"-Dio.netty.maxDirectMemory=33554432",
// avoids JDK 24+ warning
"--enable-native-access=ALL-UNNAMED"
]
}

Expand Down Expand Up @@ -646,7 +648,7 @@ tasks.register("dockerDistUntar") {
}

def dockerImage = "consensys/teku"
def dockerJdkVariants = [ "jdk21" ]
def dockerJdkVariants = [ "jdk21", "jdk24" ]
def dockerBuildDir = "build/docker-teku/"

def executableAndArg = System.getProperty('os.name').toLowerCase().contains('windows') ? ["cmd", "/c"] : ["sh", "-c"]
Expand Down
64 changes: 64 additions & 0 deletions docker/jdk24/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
FROM eclipse-temurin:24 as jre-build

# Create a custom Java runtime
RUN JAVA_TOOL_OPTIONS="-Djdk.lang.Process.launchMechanism=vfork" $JAVA_HOME/bin/jlink \
--add-modules java.se \
--add-modules jdk.httpserver \
--strip-debug \
--no-man-pages \
--no-header-files \
--compress=2 \
--output /javaruntime

FROM ubuntu:24.04
ENV JAVA_HOME=/opt/java/openjdk
ENV PATH "${JAVA_HOME}/bin:${PATH}"
COPY --from=jre-build /javaruntime $JAVA_HOME

RUN apt-get -y update && apt-get -y upgrade && apt-get -y install curl libc-bin libc6 adduser && \
# Clean apt cache
apt-get clean && \
rm -rf /var/cache/apt/archives/* && \
rm -rf /var/lib/apt/lists/*

# Ubuntu 23.10 and above comes with an "ubuntu" user with uid 1000. We need 1000 for teku.
RUN userdel ubuntu 2>/dev/null || true && rm -rf /home/ubuntu && \
adduser --uid 1000 --disabled-password --gecos "" --home /opt/teku teku && \
chown teku:teku /opt/teku && \
chmod 0755 /opt/teku

USER teku
WORKDIR /opt/teku

# copy application (with libraries inside)
COPY --chown=teku:teku teku /opt/teku/

# Default to UTF-8 locale
ENV LANG C.UTF-8

ENV TEKU_REST_API_INTERFACE="0.0.0.0"
ENV TEKU_VALIDATOR_API_INTERFACE="0.0.0.0"
ENV TEKU_METRICS_INTERFACE="0.0.0.0"
ENV PATH "/opt/teku/bin:${PATH}"

# List Exposed Ports
# Metrics, Rest API, LibP2P, Discv5
EXPOSE 8008 5051 9000 9000/udp

# specify default command
ENTRYPOINT ["/opt/teku/bin/teku"]


# Build-time metadata as defined at http://label-schema.org
ARG BUILD_DATE
ARG VCS_REF
ARG VERSION
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.name="Teku" \
org.label-schema.description="Ethereum Consensus Client" \
org.label-schema.url="https://docs.teku.consensys.io/" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url="https://github.com/Consensys/teku.git" \
org.label-schema.vendor="Consensys" \
org.label-schema.version=$VERSION \
org.label-schema.schema-version="1.0"