Skip to content

Instantly share code, notes, and snippets.

@initcron
Last active August 13, 2024 11:31
Show Gist options
  • Save initcron/cadf5c920e5e7d1cb45803c36b656947 to your computer and use it in GitHub Desktop.
Save initcron/cadf5c920e5e7d1cb45803c36b656947 to your computer and use it in GitHub Desktop.
User Data with Docker Only 2024
#!/bin/bash
apt-get update
apt-get install -y git wget
# Install Docker
apt-get install -yq \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
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
# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
tee /etc/apt/sources.list.d/docker.list > /dev/null
apt-get update
apt-get -yq install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment