Gary Wu | 1ff5667 | 2018-01-17 20:51:45 -0800 | [diff] [blame] | 1 | #!/bin/bash -x |
| 2 | printenv |
| 3 | |
| 4 | echo `hostname -I` `hostname` >> /etc/hosts |
| 5 | mkdir -p /etc/docker |
Gary Wu | 3ad596f | 2018-02-08 07:16:37 -0800 | [diff] [blame] | 6 | if [ ! -z "__docker_proxy__" ]; then |
| 7 | cat > /etc/docker/daemon.json <<EOF |
Gary Wu | 1ff5667 | 2018-01-17 20:51:45 -0800 | [diff] [blame] | 8 | { |
| 9 | "insecure-registries" : ["__docker_proxy__"] |
| 10 | } |
| 11 | EOF |
Gary Wu | 3ad596f | 2018-02-08 07:16:37 -0800 | [diff] [blame] | 12 | fi |
| 13 | if [ ! -z "__apt_proxy__" ]; then |
| 14 | cat > /etc/apt/apt.conf.d/30proxy<<EOF |
Gary Wu | 1ff5667 | 2018-01-17 20:51:45 -0800 | [diff] [blame] | 15 | Acquire::http { Proxy "http://__apt_proxy__"; }; |
| 16 | Acquire::https::Proxy "DIRECT"; |
| 17 | EOF |
Gary Wu | 3ad596f | 2018-02-08 07:16:37 -0800 | [diff] [blame] | 18 | fi |
Gary Wu | 1ff5667 | 2018-01-17 20:51:45 -0800 | [diff] [blame] | 19 | apt-get -y update |
| 20 | apt-get -y install docker.io |
| 21 | usermod -aG docker ubuntu |
| 22 | docker run --restart unless-stopped -d -p 8080:8080 rancher/server:v1.6.10 |