-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker.sh
More file actions
57 lines (43 loc) · 1.44 KB
/
Copy pathdocker.sh
File metadata and controls
57 lines (43 loc) · 1.44 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#cloud-config
users:
- default
- name: andylab
passwd:
lock_passwd: false
sudo: ALL=(ALL) NOPASSWD:ALL
ssh_authorized_keys:
- ssh-rsa
ssh_pwauth: yes
password:
chpasswd:
expire: False
list:
- root:
write_files:
- content: |
#!/usr/bin/env bash
set -x
echo "proxy=http://localhost:53128" >> /etc/yum.conf
yum -y check-update
yum -y upgrade
yum -y install yum-utils device-mapper-persistent-data lvm2 traceroute openldap-clients nss-pam-ldapd epel-release
yum -y install python36 python36-pip
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum -y install docker-ce docker-ce-cli containerd.io
mkdir /etc/docker
echo -e '{\n "userns-remap": "default"\n}' > /etc/docker/daemon.json
echo "dockremap:100000:65536" >> /etc/subuid
echo "dockremap:100000:65536" >> /etc/subgid
ns=$(sysctl user.max_pid_namespaces | sed -e 's/pid/user/')
echo ${ns} > /etc/sysctl.d/00-docker.conf
sysctl -w $(echo ${ns} | sed -e 's/[[:space:]]*//g')
systemctl start docker
systemctl enable docker
export http_proxy=http://localhost:53128; export https_proxy=${http_proxy}
pip3 install --upgrade pip
pip install docker dumper pyyaml
usermod -a -G docker andylab
mkdir /opt/docker
chown andylab. /opt/docker
path: /root/docker-setup.sh
permissions: '0700'