Last active
August 12, 2016 23:22
-
-
Save udienz/231e586ccd56768d5d70a5894caaa03b to your computer and use it in GitHub Desktop.
Docker Swarm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -ex | |
NAME=swarm | |
lxc stop $NAME | |
lxc delete $NAME | |
lxc launch ubuntu:16.04 $NAME -p default -p docker | |
#sleep 20 | |
lxc config set docker security.privileged true | |
lxc restart $NAME | |
sleep 20 | |
lxc exec $NAME -- apt-get update | |
lxc exec $NAME -- apt-get dist-upgrade -y | |
lxc exec $NAME -- apt-get install docker.io wget -y | |
lxc exec $NAME -- docker info | |
lxc exec $NAME -- wget --no-check-certificate https://gist.githubusercontent.com/udienz/231e586ccd56768d5d70a5894caaa03b/raw/6ea4b872a6886e5856c8eb26ef53432810de1419/docker.service -O /etc/systemd/system/docker.service | |
lxc exec $NAME -- systemctl daemon-reload | |
lxc exec $NAME -- systemctl restart docker |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Service] | |
ExecStart=/usr/bin/docker daemon -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock --dns 8.8.8.8 --dns 8.8.4.4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment