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

Run apt-get in docker builds without using any cache. #7011

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
26 changes: 15 additions & 11 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@

FROM ubuntu:23.10
ARG VERSION="dev"

RUN apt-get update && \
apt-get install --no-install-recommends -q --assume-yes openjdk-21-jre-headless=21* libjemalloc-dev=5.* adduser=3* && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
# Ubuntu 23.10 comes with an "ubuntu" user with uid 1000. We need 1000 for besu.
userdel ubuntu 2>/dev/null || true && rm -rf /home/ubuntu && \
# Ensure we use a stable UID for besu, as file permissions are tied to UIDs.
adduser --uid 1000 --disabled-password --gecos "" --home /opt/besu besu && \
chown besu:besu /opt/besu && \
chmod 0755 /opt/besu
ENV NO_PROXY_CACHE="-o Acquire::BrokenProxy=true -o Acquire::http::No-Cache=true -o Acquire::http::Pipeline-Depth=0"

# Update and install dependencies without using any cache
RUN apt-get update $NO_PROXY_CACHE && \
apt-get install $NO_PROXY_CACHE --no-install-recommends -q --assume-yes openjdk-21-jre-headless=21* libjemalloc-dev=5.* adduser=3* && \
# Clean apt cache
apt-get clean && \
rm -rf /var/cache/apt/archives/* /var/cache/apt/archives/partial/* && \
rm -rf /var/lib/apt/lists/* && \
# Ubuntu 23.10 comes with an "ubuntu" user with uid 1000. We need 1000 for besu.
userdel ubuntu 2>/dev/null || true && rm -rf /home/ubuntu && \
# Ensure we use a stable UID for besu, as file permissions are tied to UIDs.
adduser --uid 1000 --disabled-password --gecos "" --home /opt/besu besu && \
chown besu:besu /opt/besu && \
chmod 0755 /opt/besu

USER besu
WORKDIR /opt/besu
Expand Down
19 changes: 12 additions & 7 deletions ethereum/evmtool/src/main/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@

FROM ubuntu:22.04
ARG VERSION="dev"
ENV NO_PROXY_CACHE="-o Acquire::BrokenProxy=true -o Acquire::http::No-Cache=true -o Acquire::http::Pipeline-Depth=0"

RUN apt-get update && \
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* && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
adduser --disabled-password --gecos "" --home /opt/besu besu && \
chown besu:besu /opt/besu
# Update and install dependencies without using any cache
RUN apt-get update $NO_PROXY_CACHE && \
apt-get install $NO_PROXY_CACHE --no-install-recommends -q --assume-yes ca-certificates-java=20190909* && \
apt-get install $NO_PROXY_CACHE --no-install-recommends -q --assume-yes openjdk-17-jre-headless=17* && \
# Clean apt cache \
apt-get clean && \
rm -rf /var/cache/apt/archives/* /var/cache/apt/archives/partial/* && \
rm -rf /var/lib/apt/lists/* && \
# Creating a user for besu
adduser --disabled-password --gecos "" --home /opt/besu besu && \
chown besu:besu /opt/besu

USER besu
WORKDIR /opt/besu-evmtool
Expand Down
Loading