#!/usr/bin/env bash # Installs Docker Engine in an Ubuntu WSL distribution. Run as root. set -euo pipefail if [[ "${EUID}" -ne 0 ]]; then echo "Run this script as root." >&2 exit 1 fi . /etc/os-release if [[ "${ID}" != "ubuntu" ]]; then echo "This installer supports Ubuntu only (detected: ${ID})." >&2 exit 1 fi apt-get update DEBIAN_FRONTEND=noninteractive apt-get install -y ca-certificates curl install -m 0755 -d /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc chmod a+r /etc/apt/keyrings/docker.asc cat > /etc/apt/sources.list.d/docker.sources <