-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_docker.sh
executable file
·39 lines (33 loc) · 1.22 KB
/
install_docker.sh
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
35
36
37
38
#!/usr/bin/bash
set -ex
# copied from here: https://docs.docker.com/engine/install/ubuntu/
if ! [ -z ${1+x} ] && [ $1 = "--client-only" ]; then
CLIENT_ONLY=$1
else
CLIENT_ONLY="no"
fi
apt-get update
apt-get install -y ca-certificates curl gnupg
install -m 0755 -d /etc/apt/keyrings
# I added --batch and --yes
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg --batch --yes
chmod a+r /etc/apt/keyrings/docker.gpg
echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] 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
if [ $CLIENT_ONLY = "no" ]; then
apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
else
apt-get install -y docker-ce-cli docker-ce # we only iclude
# docker-ce so it'll
# create the docker
# group in a way
# consistent with the
# other images. A
# better solution would
# probably be to create
# the docker group
# ourselves.
fi