Skip to content

Commit f759e03

Browse files
committed
Silence apt-get and uniformize calls format
Signed-off-by: apostasie <[email protected]>
1 parent b028812 commit f759e03

File tree

1 file changed

+24
-19
lines changed

1 file changed

+24
-19
lines changed

Dockerfile

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,19 @@ FROM --platform=$BUILDPLATFORM tonistiigi/xx:1.4.0 AS xx
5757
FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-bullseye AS build-base-debian
5858
COPY --from=xx / /
5959
ENV DEBIAN_FRONTEND=noninteractive
60-
RUN apt-get update && \
61-
apt-get install -y git pkg-config dpkg-dev
60+
RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
61+
git \
62+
pkg-config \
63+
dpkg-dev
6264
ARG TARGETARCH
6365
# libbtrfs: for containerd
6466
# libseccomp: for runc and bypass4netns
65-
RUN xx-apt-get update && \
66-
xx-apt-get install -y binutils gcc libc6-dev libbtrfs-dev libseccomp-dev
67+
RUN xx-apt-get update -qq && xx-apt-get install -qq --no-install-recommends \
68+
binutils \
69+
gcc \
70+
libc6-dev \
71+
libbtrfs-dev \
72+
libseccomp-dev
6773

6874
FROM build-base-debian AS build-containerd
6975
ARG TARGETARCH
@@ -241,14 +247,13 @@ COPY --from=build-full /out /
241247

242248
FROM ubuntu:${UBUNTU_VERSION} AS base
243249
# fuse3 is required by stargz snapshotter
244-
RUN apt-get update && \
245-
apt-get install -qq -y --no-install-recommends \
246-
apparmor \
247-
bash-completion \
248-
ca-certificates curl \
249-
iproute2 iptables \
250-
dbus dbus-user-session systemd systemd-sysv \
251-
fuse3
250+
RUN apt-get update -qq && apt-get install -qq -y --no-install-recommends \
251+
apparmor \
252+
bash-completion \
253+
ca-certificates curl \
254+
iproute2 iptables \
255+
dbus dbus-user-session systemd systemd-sysv \
256+
fuse3
252257
ARG CONTAINERIZED_SYSTEMD_VERSION
253258
RUN curl -L -o /docker-entrypoint.sh https://raw.githubusercontent.com/AkihiroSuda/containerized-systemd/${CONTAINERIZED_SYSTEMD_VERSION}/docker-entrypoint.sh && \
254259
chmod +x /docker-entrypoint.sh
@@ -274,9 +279,9 @@ RUN go env GOVERSION > /GOVERSION
274279
FROM base AS test-integration
275280
ARG DEBIAN_FRONTEND=noninteractive
276281
# `expect` package contains `unbuffer(1)`, which is used for emulating TTY for testing
277-
RUN apt-get update && \
278-
apt-get install -qq -y \
279-
expect git
282+
RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
283+
expect \
284+
git
280285
COPY --from=goversion /GOVERSION /GOVERSION
281286
ARG TARGETARCH
282287
RUN curl -L https://golang.org/dl/$(cat /GOVERSION).linux-${TARGETARCH:-amd64}.tar.gz | tar xzvC /usr/local
@@ -320,10 +325,10 @@ FROM test-integration AS test-integration-rootless
320325
# Install SSH for creating systemd user session.
321326
# (`sudo` does not work for this purpose,
322327
# OTOH `machinectl shell` can create the session but does not propagate exit code)
323-
RUN apt-get update && \
324-
apt-get install -qq -y \
325-
uidmap \
326-
openssh-server openssh-client
328+
RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
329+
uidmap \
330+
openssh-server \
331+
openssh-client
327332
# TODO: update containerized-systemd to enable sshd by default, or allow `systemctl wants <TARGET> ssh` here
328333
RUN ssh-keygen -q -t rsa -f /root/.ssh/id_rsa -N '' && \
329334
useradd -m -s /bin/bash rootless && \

0 commit comments

Comments
 (0)