Last active
March 10, 2017 22:22
-
-
Save fike/c9b7c2e572928209b5e8bf9585308a0a to your computer and use it in GitHub Desktop.
centos_docker.sh
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
yum install -y yum-utils | |
yum-config-manager \ | |
--add-repo \ | |
https://download.docker.com/linux/centos/docker-ce.repo | |
yum makecache fast | |
yum install docker-ce.x86_64 | |
mkdir -p /etc/systemd/system/docker.service.d/ | |
cat << EOF >> /etc/systemd/system/docker.service.d/environment.conf | |
[Service] | |
ExecStart= | |
ExecStart=/usr/bin/dockerd -H unix:///var/run/docker.sock --cluster-advertise=eth0:2376 --cluster-store=consul://127.0.0.1:8500 | |
EOF | |
systemctl daemon-reload | |
systemctl restart docker | |
docker run -d -p 8400:8400 -p 8500:8500 -p 53:53 -h consul-server --name consul progrium/consul -server -bootstrap | |
docker run -d \ | |
--name=registrator \ | |
--net=host \ | |
--volume=/var/run/docker.sock:/tmp/docker.sock \ | |
gliderlabs/registrator:latest \ | |
consul://localhost:8500 | |
docker network create --driver overlay foobar | |
docker run -it --net=foobar --name=bar centos ping foo | |
docker run -it --net=foobar --name=foo centos ping bar | |
docker run -d -P --name nginx --net=foobar nginx |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment