Skip to content

Instantly share code, notes, and snippets.

@akanto
Last active August 29, 2015 14:26
Show Gist options
  • Select an option

  • Save akanto/3bc6140a4aadece4677c to your computer and use it in GitHub Desktop.

Select an option

Save akanto/3bc6140a4aadece4677c to your computer and use it in GitHub Desktop.
docker install
: << 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