Skip to content

Instantly share code, notes, and snippets.

@niko-dunixi
Forked from zulhfreelancer/install-docker.md
Last active November 9, 2020 02:51
Show Gist options
  • Save niko-dunixi/b8b48e3a2b816bd167f3f56e050df9f2 to your computer and use it in GitHub Desktop.
Save niko-dunixi/b8b48e3a2b816bd167f3f56e050df9f2 to your computer and use it in GitHub Desktop.
Install Docker oneliner script

Install Docker

$ curl -sSL https://get.docker.com/ | sh && sudo usermod -aG docker ${USER}

Install within a Dockerfile (Buildkit)

FROM ubuntu:latest
ENV debian_frontend=noninteractive
RUN rm -f /etc/apt/apt.conf.d/docker-clean; echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
RUN --mount=type=cache,target=/var/cache/apt --mount=type=cache,target=/var/lib/apt \
    apt-get update && apt-get install -y curl apt-utils && \
    curl -sSL https://get.docker.com/ | sh && \
    usermod -a -G docker root && \
    docker --version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment