Last active
September 3, 2020 02:07
-
-
Save nebhale/00dec9db288a2ee50be96b400c46db0f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Download and verify file | |
# Args: $DOWNLOAD_URI, $SHA256 | |
FROM ubuntu:bionic AS retrieve | |
RUN apt-get update && apt-get install --no-install-recommends -y \ | |
ca-certificates \ | |
curl \ | |
&& rm -rf /var/lib/apt/lists/* | |
ARG DOWNLOAD_URI | |
RUN curl -L \ | |
$DOWNLOAD_URI \ | |
> download.tar.gz | |
ARG SHA256 | |
RUN echo "${SHA256} download.tar.gz" | sha256sum -c - 2>&1 | |
# Install File | |
FROM ubuntu:bionic | |
ENV JAVA_HOME /usr/lib/jvm/jre | |
ENV PATH $JAVA_HOME/bin:$PATH | |
COPY --from=retrieve download.tar.gz /tmp/download.tar.gz | |
RUN mkdir -p /usr/lib/jvm \ | |
&& tar xzf /tmp/download.tar.gz -C /usr/lib/jvm \ | |
&& ln -s /usr/lib/jvm/* /usr/lib/jvm/jre \ | |
&& rm /tmp/download.tar.gz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment