Split rootless and with root for dockerd
Some checks failed
ci/woodpecker/push/dockerhub Pipeline was successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/build Pipeline failed

This commit is contained in:
Stephan Schnabel 2025-06-21 09:06:01 +02:00
parent d2467219a1
commit 8811ef97a1
Signed by: stephan.schnabel
SSH key fingerprint: SHA256:99zuzxNGFb5/5P+E/O7ONU2qhUojUe/D8rIPTW+9Xp0
5 changed files with 48 additions and 5 deletions

View file

@ -5,7 +5,6 @@
##
FROM docker.io/library/debian:12.11-slim@sha256:e5865e6858dacc255bead044a7f2d0ad8c362433cfaa5acefb670c1edf54dfef AS download
SHELL ["/bin/bash", "-u", "-e", "-o", "pipefail", "-c"]
WORKDIR /tmp/docker
RUN --mount=type=cache,target=/var/lib/apt/lists,sharing=locked \
--mount=type=cache,target=/var/cache \
@ -25,7 +24,21 @@ RUN ARCH=$(dpkg --print-architecture) && curl --fail --silent --parallel --remot
##
FROM docker.io/library/debian:12.11-slim@sha256:e5865e6858dacc255bead044a7f2d0ad8c362433cfaa5acefb670c1edf54dfef AS dockerd
SHELL ["/bin/bash", "-u", "-e", "-o", "pipefail", "-c"]
RUN --mount=type=bind,from=download,source=/tmp/docker,target=/tmp/docker \
--mount=type=cache,target=/var/lib/apt/lists,sharing=locked \
--mount=type=cache,target=/var/cache \
--mount=type=tmpfs,target=/var/log \
apt-get -qq update && \
apt-get -qq install --yes --no-install-recommends /tmp/docker/containerd*.deb /tmp/docker/docker-ce-cli* /tmp/docker/docker-ce_*.deb ca-certificates && \
rm -rf /var/lib/dpkg/*-old /var/lib/dpkg/status
COPY --chmod=555 entrypoint-rootless.sh /usr/bin/entrypoint.sh
ENTRYPOINT ["/usr/bin/entrypoint.sh"]
##
## Docker Daemon (rootless)
##
FROM docker.io/library/debian:12.11-slim@sha256:e5865e6858dacc255bead044a7f2d0ad8c362433cfaa5acefb670c1edf54dfef AS dockerd-rootless
RUN --mount=type=bind,from=download,source=/tmp/docker,target=/tmp/docker \
--mount=type=cache,target=/var/lib/apt/lists,sharing=locked \
--mount=type=cache,target=/var/cache \
@ -46,7 +59,6 @@ USER 1000
##
FROM docker.io/library/debian:12.11-slim@sha256:e5865e6858dacc255bead044a7f2d0ad8c362433cfaa5acefb670c1edf54dfef AS cli-base
SHELL ["/bin/bash", "-u", "-e", "-o", "pipefail", "-c"]
RUN --mount=type=bind,from=download,source=/tmp/docker,target=/tmp/docker \
--mount=type=cache,target=/var/lib/apt/lists,sharing=locked \
--mount=type=cache,target=/var/cache \