We are trying to set up a swarm of hosts in a private, operational network which must be controlled in terms of version numbers of images, tools etc. No internet access is permitted from these hosts. Images can be installed onto hosts via docker save / load.
docker-engine is pre-installed, but docker-machine create attempts to access index.docker.io, resulting in Error creating machine:
Error creating machine: Error running provisioning: Unable to pull image: Error while pulling image: Get https://index.docker.io/v1/repositories/library/swarm/images: dial tcp: lookup index.docker.io: no such host
s
Note that a swarm image is pre-installed on the host:
@dvohra: The described hosts are physical PCs running Linux. My understanding was that docker-machine create provisions hosts (incl setting the hostname), and that a discovery container plus swarm-containers with manager and / or node roles are subsequently launched on such hosts using docker swarm. The intention is that several hosts/machines (swarm1, swarm2, swarm3) act as both manager and node, thus avoiding a single point of failure / providing high availability.
So to me swarm1 is the hostname of the physical machine & I don’t really understand why you refer to swarm1 as an ‘image’. Please correct if I’m wrong!
This may be the cause of the error, however the question was how to prevent the attempts to access the internet. The require swarm image is already installed on the host:
Ok, so the answer is: For a private cluster (no nodes in the cloud) there is no need to create a swarm token, and no need to create anything using docker-machine. In fact docker-machine is not needed at all. We deploy required images (‘swarm’, ‘consul’ & our own apps) via docker save / docker load. The is it possible simply to start consul, manage & node on the hosts.
Docker swarm needs a discovery backend and the discovery-token is used when you use the swarm discovery backend provided by hub.docker.com. You can run your own consul discovery backend, just pass consul://ip:port instead of token://token
You’ll always need internet access when using the hosted discovery backend!
Hi Guys, i’m a master’s student working on my thesis. i’m trying to setup a docker swarm without internet, i have two pc on localLAN. one as leader and another as worker. i created swarm exposing the privateIP of leader
--advertise-addr 192.168.1.202
i executed worker token on worker node and i can see worker node is in swarm but service is failing .!! any help please