Installing Docker on Debian image ends up with a huge image

Viewed 160

I'm baking a Debian Docker image with Docker installed. When I follow the official instructions on installing Docker on Debian I end up with an 871MB size image. The official Docker image (built on Alpine) is closer to around 60-70MB. I don't understand why using Debian would need hundreds of additional MB.

Any ideas on how I can reduce the image size? Below is my Dockerfile.

FROM debian:buster-slim

RUN apt-get update \
    && apt-get install -y \
        curl \
        gnupg-agent \
        software-properties-common \
        lsb-release \
    && curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - \
    && add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" \
    && apt-get update \
    && apt-get install -y docker-ce docker-ce-cli containerd.io \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*
0 Answers
Related