-
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathinstall-docker
More file actions
executable file
·49 lines (36 loc) · 893 Bytes
/
Copy pathinstall-docker
File metadata and controls
executable file
·49 lines (36 loc) · 893 Bytes
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
44
45
46
47
48
49
#!/bin/sh
set -e
#dependencies
./install-docker-zfs-plugin
echo "ALPINEBOX: Installing Docker"
#install
apk add docker docker-bash-completion docker-cli-compose
#configuration
mkdir -p /etc/docker
cat << EOF > /etc/docker/daemon.json
{
"storage-driver": "zfs",
"storage-opts": ["zfs.fsname=rpool/var/lib/docker/images"],
"default-address-pools":
[
{"base":"172.19.0.0/16","size":24 }
],
"log-opts": {
"max-size": "1m",
"max-file": "2"
},
"dns-opts": ["ndots:1"]
}
EOF
#enable and start docker service
rc-update add docker
rc-service docker restart
#set some sysctl stuff neccessary for some containers
cat << EOF > /etc/sysctl.d/docker.conf
#for opensearch/elasticsearch
vm.max_map_count=1024000
#for some containers
fs.inotify.max_user_instances=1024
EOF
service sysctl restart
echo "ALPINEBOX: Docker installed"