Created
July 1, 2014 01:40
-
-
Save rochacon/8954fbfe4a667514c49f to your computer and use it in GitHub Desktop.
Simple userdata to install and configure a Docker node
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 | |
# This will install the latest version of Docker and configure it to | |
# listen to /var/run/docker.sock and 0.0.0.0:2375 | |
ufw allow ssh | |
ufw limit ssh | |
ufw enable | |
apt-get update -y && apt-get upgrade -yq | |
curl -s https://get.docker.io/ubuntu/ | sh | |
sed -i .bak -e 's/^DEFAULT_FORWARD_POLICY.*$/DEFAULT_FORWARD_POLICY="ACCEPT"/g' /etc/default/ufw | |
ufw reload | |
usermod -a -G docker ubuntu | |
cp /etc/default/docker{,.bak} | |
echo 'DOCKER_OPTS="-H unix:///var/run/docker.sock -H tcp://0.0.0.0:2375"' | tee /etc/default/docker | |
restart docker |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment