Added all
This commit is contained in:
@@ -153,7 +153,7 @@ creates an overlay network named ingress for publishing service ports external t
|
|||||||
The output for docker swarm init provides the connection command to use when you join new worker nodes to the swarm:
|
The output for docker swarm init provides the connection command to use when you join new worker nodes to the swarm:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
$ docker swarm init
|
$ docker swarm init --advertise-addr 192.168.0.248
|
||||||
Swarm initialized: current node (dxn1zf6l61qsb1josjja83ngz) is now a manager.
|
Swarm initialized: current node (dxn1zf6l61qsb1josjja83ngz) is now a manager.
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
3
swarm/Vagrantfile
vendored
3
swarm/Vagrantfile
vendored
@@ -9,7 +9,8 @@ Vagrant.configure(2) do |config|
|
|||||||
manager.vm.network "forwarded_port", guest: 8000, host: 8000
|
manager.vm.network "forwarded_port", guest: 8000, host: 8000
|
||||||
manager.vm.network "forwarded_port", guest: 5000, host: 5000
|
manager.vm.network "forwarded_port", guest: 5000, host: 5000
|
||||||
manager.vm.network "forwarded_port", guest: 6379, host: 6379
|
manager.vm.network "forwarded_port", guest: 6379, host: 6379
|
||||||
|
manager.vm.network "forwarded_port", guest: 2375, host: 2375
|
||||||
|
manager.vm.network "forwarded_port", guest: 2376, host: 2376
|
||||||
end
|
end
|
||||||
config.vm.define "agent1" do |agent1|
|
config.vm.define "agent1" do |agent1|
|
||||||
agent1.vm.box = "bento/ubuntu-18.04"
|
agent1.vm.box = "bento/ubuntu-18.04"
|
||||||
|
|||||||
@@ -10,13 +10,16 @@ apt-get install -y --no-install-recommends \
|
|||||||
gnupg2 \
|
gnupg2 \
|
||||||
software-properties-common
|
software-properties-common
|
||||||
apt-get remove docker docker-engine docker.io
|
apt-get remove docker docker-engine docker.io
|
||||||
# install docker
|
|
||||||
curl -fsSL get.docker.com -o get-docker.sh
|
curl -fsSL get.docker.com -o get-docker.sh
|
||||||
sh get-docker.sh
|
sh get-docker.sh
|
||||||
|
|
||||||
# install docker-compose
|
# install docker-compose
|
||||||
curl -L "https://github.com/docker/compose/releases/download/1.21.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && \
|
curl -L "https://github.com/docker/compose/releases/download/1.21.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && \
|
||||||
chmod +x /usr/local/bin/docker-compose
|
chmod +x /usr/local/bin/docker-compose
|
||||||
apt-get -y install linux-image-extra-$(uname -r)
|
|
||||||
usermod -aG docker vagrant
|
# install docker-machine
|
||||||
echo 'DOCKER_OPTS="-H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock"' >> /etc/default/docker
|
curl -L "https://github.com/docker/machine/releases/download/v0.15.0/docker-machine-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-machine && \
|
||||||
service docker restart
|
chmod +x /usr/local/bin/docker-machine
|
||||||
|
|
||||||
|
usermod -G docker vagrant
|
||||||
|
|||||||
Reference in New Issue
Block a user