-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path24_docker.sh
44 lines (35 loc) · 1.19 KB
/
24_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
39
40
41
42
43
source config.sh
source helper.sh
# this allows to substitute in iptables-nft. Needed for kubectl and friends
if pacman -Q iptables ; then
pacman -Rdd --noconfirm iptables
fi
pacman -S --needed --noconfirm \
docker arch-install-scripts lxc haveged \
"bind" docker-compose \
bridge-utils lua-alt-getopt ca-certificates \
iptables-nft kubeadm kubelet kubectl
usermod -a -G docker ${USERNAME}
if [ -z ${DOCKERSTORAGEPATH+x} ]; then
DOCKERSTORAGEPATH=/home/${USERNAME}/docker
sudo --user ${USERNAME} mkdir -p ${DOCKERSTORAGEPATH}
fi
mkdir -p /etc/systemd/system/docker.service.d
cat > /etc/systemd/system/docker.service.d/my_config.conf << EODOCKERCONF
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd \\
-H fd:// \\
--exec-opt native.cgroupdriver=cgroupfs \\
--storage-driver overlay2 \\
--data-root ${DOCKERSTORAGEPATH}
EODOCKERCONF
#systemctl daemon-reload
enable_service docker.service
update-ca-trust
# set up .bashrc with some aliases
if ! grep -q 'alias dockerps=' /home/${USERNAME}/.bashrc ; then
echo -e \
"alias dockerps='docker ps --format \"table {{.Names}}\\t{{.Image}}\\t{{.Ports}}\\t{{.Status}}\"\n'" \
>> /home/${USERNAME}/.bashrc
fi