Skip to content

Commit a324a2d

Browse files
committed
Dockerfiles: add --no-install-recommends to all apt-get install cmds
- Reduces Docker image size by avoiding installation of recommended packages - Fixes hadolint DL3015 warnings across all Dockerfiles
1 parent 9774ae7 commit a324a2d

File tree

10 files changed

+13
-13
lines changed

10 files changed

+13
-13
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
FROM rust:bullseye AS build
2-
RUN apt-get update && apt-get install -y protobuf-compiler && apt-get clean
2+
RUN apt-get update && apt-get install -y --no-install-recommends protobuf-compiler && apt-get clean
33
RUN rustup default 1.84 && rustup component add rustfmt
44
WORKDIR /openmina
55
COPY . .
@@ -19,7 +19,7 @@ RUN git clone --depth 1 https://github.com/openmina/circuit-blobs.git \
1919
&& rm -rf circuit-blobs/berkeley_rc1 circuit-blobs/*/tests
2020

2121
FROM debian:bullseye
22-
RUN apt-get update && apt-get install -y libjemalloc2 libssl1.1 libpq5 curl jq procps && apt-get clean
22+
RUN apt-get update && apt-get install -y --no-install-recommends libjemalloc2 libssl1.1 libpq5 curl jq procps && apt-get clean
2323

2424
COPY --from=build /openmina/release-bin/openmina /usr/local/bin/
2525
COPY --from=build /openmina/testing-release-bin/openmina-node-testing /usr/local/bin/

docker/producer-dashboard/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ RUN cd producer-dashboard && SQLX_OFFLINE=true cargo install --path .
88

99
FROM ubuntu:noble AS mina-builder
1010

11-
RUN apt-get update && apt-get install -y openssl ca-certificates
11+
RUN apt-get update && apt-get install -y --no-install-recommends openssl ca-certificates
1212

1313
# Build mina from source
1414
RUN apt-get update && \
@@ -78,7 +78,7 @@ RUN eval $(opam config env) && make build_all_sigs
7878

7979
FROM ubuntu:noble
8080

81-
RUN apt-get update && apt-get install -y libpq5 libjemalloc2
81+
RUN apt-get update && apt-get install -y --no-install-recommends libpq5 libjemalloc2
8282

8383
COPY --from=app-builder /usr/local/cargo/bin/openmina-producer-dashboard /usr/local/bin/openmina-producer-dashboard
8484
COPY --from=mina-builder /go/mina/src/app/libp2p_helper/result/bin/libp2p_helper /usr/local/bin/coda-libp2p_helper

frontend/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ RUN echo "---------- USING APACHE ----------"
1313
FROM httpd:2.4
1414

1515
RUN apt-get update && \
16-
apt-get install -y curl && \
16+
apt-get install -y --no-install-recommends curl && \
1717
rm -rf /var/lib/apt/lists/*
1818

1919
COPY --from=BUILD_IMAGE /app/dist/frontend/browser /usr/local/apache2/htdocs/

node/testing/docker/Dockerfile.debugger

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ FROM minaprotocol/mina-daemon:2.0.0rampup4-14047c5-focal-berkeley
55

66
COPY --from=debugger /usr/bin/bpf-recorder /usr/bin/bpf-recorder
77

8-
RUN apt-get update && apt-get -y install libelf-dev
8+
RUN apt-get update && apt-get -y install --no-install-recommends libelf-dev

node/testing/docker/Dockerfile.light

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM golang:1.18.10-buster AS builder
22

33
RUN apt-get update && \
4-
apt-get -y install \
4+
apt-get -y install --no-install-recommends \
55
apt-transport-https \
66
ca-certificates \
77
pkg-config \

node/testing/docker/Dockerfile.light.focal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM golang:1.18.10-focal AS builder
22

33
RUN apt-get update && \
4-
apt-get -y install \
4+
apt-get -y install --no-install-recommends \
55
apt-transport-https \
66
ca-certificates \
77
pkg-config \

node/testing/docker/Dockerfile.openmina

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FROM ubuntu:20.04 AS builder
33
ENV TZ=UTC
44
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
55
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
6-
apt-get -y install git curl gcc libssl-dev pkg-config
6+
apt-get -y install --no-install-recommends git curl gcc libssl-dev pkg-config
77

88
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
99

tools/bootstrap-sandbox/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ RUN cargo install --git https://github.com/openmina/openmina.git --branch fix/bo
88

99
FROM debian:bullseye
1010

11-
RUN apt-get update && apt-get install -y libssl-dev
11+
RUN apt-get update && apt-get install -y --no-install-recommends libssl-dev
1212

1313
COPY --from=builder /usr/local/cargo/bin/openmina-bootstrap-sandbox \
1414
/usr/local/bin/openmina-bootstrap-sandbox

tools/fuzzing/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FROM debian:bullseye
33

44
RUN apt -y update && \
55
apt -y upgrade && \
6-
apt -y install \
6+
apt -y install --no-install-recommends \
77
apt-transport-https \
88
ca-certificates \
99
pkg-config \

tools/heartbeats-processor/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
FROM rust:1.84-slim-bookworm AS builder
33

44
WORKDIR /usr/src/app
5-
RUN apt-get update && apt-get install -y pkg-config libssl-dev && rm -rf /var/lib/apt/lists/*
5+
RUN apt-get update && apt-get install -y --no-install-recommends pkg-config libssl-dev && rm -rf /var/lib/apt/lists/*
66

77
COPY . .
88
RUN ls -la tools/heartbeats-processor
@@ -11,7 +11,7 @@ RUN cargo build --release -p heartbeats-processor
1111
# Runtime stage
1212
FROM debian:bookworm-slim
1313

14-
RUN apt-get update && apt-get install -y libsqlite3-0 ca-certificates && rm -rf /var/lib/apt/lists/*
14+
RUN apt-get update && apt-get install -y --no-install-recommends libsqlite3-0 ca-certificates && rm -rf /var/lib/apt/lists/*
1515

1616
WORKDIR /app
1717

0 commit comments

Comments
 (0)