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

clients/besu: use ubuntu base image and install java #889

Merged
merged 1 commit into from
Sep 27, 2023
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
14 changes: 9 additions & 5 deletions clients/besu/Dockerfile.git
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
### Build Besu From Git:

## Builder stage: Compiles besu from a git repository
FROM openjdk:17-jdk-slim as builder
FROM ubuntu:22.04 as builder

ARG tag=main
ARG github=hyperledger/besu

RUN echo "Cloning: $github - $tag" && \
apt-get update && apt-get install -y git libsodium-dev libnss3-dev \
RUN echo "installing java on ubuntu base image" \
&& apt-get update && apt-get install -y git libsodium-dev libnss3-dev \
&& apt-get install --no-install-recommends -q --assume-yes ca-certificates-java=20190909 \
&& apt-get install --no-install-recommends -q --assume-yes openjdk-17-jre-headless=17* libjemalloc-dev=5.* \
&& echo "Cloning: $github - $tag" \
&& git clone --depth 1 --branch $tag https://github.com/$github \
&& cd besu && ./gradlew installDist

## Final stage: Sets up the environment for running besu
FROM openjdk:17-jdk-slim
FROM ubuntu:22.04

# Copy compiled binary from builder
COPY --from=builder /besu/build/install/besu /opt/besu

RUN apt-get update && apt-get install -y curl jq libsodium23 libnss3-dev \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
&& apt-get install --no-install-recommends -q --assume-yes openjdk-17-jre-headless=17* libjemalloc-dev=5.* \
&& apt-get clean && rm -rf /var/lib/apt/lists/*

# Create version.txt
RUN /opt/besu/bin/besu --version > /version.txt
Expand Down
8 changes: 6 additions & 2 deletions clients/besu/Dockerfile.local
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
### Build Besu Locally:

## Builder stage: Compiles besu from a local directory
FROM openjdk:17-jdk-slim as builder
FROM ubuntu:22.04 as builder

# Default local client path: clients/besu/<besu>
ARG local_path=besu
COPY $local_path besu

RUN apt-get update && apt-get install -y git libsodium-dev libnss3-dev \
&& apt-get install --no-install-recommends -q --assume-yes ca-certificates-java=20190909 \
&& apt-get install --no-install-recommends -q --assume-yes openjdk-17-jre-headless=17* libjemalloc-dev=5.* \
&& cd besu && ./gradlew installDist

## Final stage: Sets up the environment for running besu
FROM openjdk:17-jdk-slim
FROM ubuntu:22.04

# Copy compiled binary from builder
COPY --from=builder /besu/build/install/besu /opt/besu

RUN apt-get update && apt-get install -y curl jq libsodium23 libnss3-dev \
&& apt-get install --no-install-recommends -q --assume-yes ca-certificates-java=20190909 \
&& apt-get install --no-install-recommends -q --assume-yes openjdk-17-jre-headless=17* libjemalloc-dev=5.* \
&& apt-get clean && rm -rf /var/lib/apt/lists/*

# Create version.txt
Expand Down