Split rootless and with root for dockerd
This commit is contained in:
parent
d2467219a1
commit
8811ef97a1
5 changed files with 48 additions and 5 deletions
18
Dockerfile
18
Dockerfile
|
@ -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 \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue