ENV JAVA_PKG=https://download.oracle.com/java/17/latest/jdk-17_linux-x64_bin.tar.gz \
JAVA_HOME=/usr/java/jdk-17
RUN set -eux; \
JAVA_SHA256=$(curl "$JAVA_PKG".sha256) ; \
curl --output /tmp/jdk.tgz "$JAVA_PKG" && \
echo "$JAVA_SHA256 */tmp/jdk.tgz" | sha256sum -c; \
mkdir -p "$JAVA_HOME"; \
tar --extract --file /tmp/jdk.tgz --directory "$JAVA_HOME" --strip-components 1
$ docker build -t myimage:latest -<<EOF
FROM busybox
RUN echo "hello world"
EOF