Last active
August 29, 2015 14:26
-
-
Save akanto/3bc6140a4aadece4677c to your computer and use it in GitHub Desktop.
docker install
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
| : << USAGE | |
| ################################## | |
| curl -L https://gist.githubusercontent.com/akanto/3bc6140a4aadece4677c/raw/7dc1661b3ce1e665e2bde82ba43f81c43d4e9bc4/docker-install | bash | |
| ################################## | |
| USAGE | |
| debug() { | |
| [[ "$DEBUG" ]] && echo "-----> $*" 1>&2 | |
| } | |
| install_utils() { | |
| yum -y install unzip curl git wget bind-utils ntp | |
| } | |
| permissive_iptables() { | |
| # need to install iptables-services, othervise the 'iptables save' command will not be available | |
| yum -y install iptables-services net-tools | |
| iptables --flush INPUT | |
| iptables --flush FORWARD | |
| service iptables save | |
| } | |
| disable_selinux() { | |
| setenforce 0 | |
| sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config | |
| } | |
| install_docker() { | |
| curl -sSL https://get.docker.com/ | sh | |
| service docker start | |
| systemctl enable docker.service | |
| } | |
| main() { | |
| install_utils | |
| disable_selinux | |
| permissive_iptables | |
| install_docker | |
| } | |
| [[ "$0" == "$BASH_SOURCE" ]] && main "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment