-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall-docker
More file actions
executable file
·34 lines (32 loc) · 1.13 KB
/
install-docker
File metadata and controls
executable file
·34 lines (32 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env bash
source:e "$HOME/.bash_functions/strict.bash"
if is-linux; then
# https://docs.docker.com/engine/install/ubuntu/
echo 'Adding Docker repository'
add-apt-repo \
https://download.docker.com/linux/ubuntu/gpg \
docker.gpg \
docker.list \
deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $UBUNTU_CODENAME stable
# https://docs.docker.com/desktop/install/ubuntu/
if ! apt list --manual-installed docker-desktop >/dev/null; then
echo 'Downloading Docker Desktop'
file=docker-desktop-4.24.2-amd64.deb
cd $(mktemp -d)
curl --remote-name https://desktop.docker.com/linux/main/amd64/$file
sudo apt install -y "./$file"
fi
# https://docs.docker.com/engine/security/rootless/
sudo apt install -y \
docker-ce \
docker-ce-cli \
docker-buildx-plugin \
docker-ce-rootless-extras \
dbus-user-session \
uidmap
sudo systemctl disable --now docker.service docker-desktop.service docker.socket || true
dockerd-rootless-setuptool.sh check
dockerd-rootless-setuptool.sh install
systemctl --user start docker-desktop
fi
docker run hello-world