Skip to content

Instantly share code, notes, and snippets.

@casperklein
Last active August 11, 2024 20:12
Show Gist options
  • Select an option

  • Save casperklein/b7301b8fda5ec9f737909496e270024b to your computer and use it in GitHub Desktop.

Select an option

Save casperklein/b7301b8fda5ec9f737909496e270024b to your computer and use it in GitHub Desktop.
FROM debian:12-slim AS build
ENV PACKAGES="make ca-certificates curl gnupg lsb-release jq python3 curl git iptables sudo file parallel"
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Install packages
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get -y upgrade \
&& apt-get -y install --no-install-recommends $PACKAGES
# Install Docker
RUN curl -fsSL https://get.docker.com | bash
# Cleanup
RUN rm -rf /var/lib/apt/lists/*
# Build final image
FROM scratch
HEALTHCHECK CMD docker version || exit 1
# /var/lib/docker cannot be on AUFS, so we make it a volume.
VOLUME /var/lib/docker
COPY --from=build / /
ENTRYPOINT ["dockerd"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment