docker / machine

Machine management for a container-centric world
https://docs.docker.com/machine/
Apache License 2.0
6.62k stars 1.97k forks source link

Add support for private Swarms #3591

Open sronsiek opened 8 years ago

sronsiek commented 8 years ago

docker-machine is, in part, provided to create docker swarms / clusters, with a variety for drivers available for various cloud based host-platforms.

Our use case is based on an operational environment, where internet access in not an option. My understanding was that the 'generic' driver is provided for such cases, allowing for non-cloud, physical servers in a private LAN.

In this environment it was noted that docker-machine:

Could command-line flag(s) be added to suppress internet access attempts where local images are available and possibly generate a key locally? Or would this be incorrect usage?

The discussion here shows it is possible to avoid docker-machine usage in the given scenario, but it seems a shame to need to forego intended machine functionality.

https://forums.docker.com/t/create-swarm-host-without-internet-access/16092

nathanleclaire commented 8 years ago

If you have the images around locally you could use --swarm-image to specify which image tag Machine should use for the Swarm image. Likewise there's no dep on generating the discovery token using Hub, it's just done that way in some examples. Just set --swarm-discovery to the local KV store's address.

adzenith commented 6 years ago

I came here to ask this same question. Even when using --swarm-image, docker-machine still tries to access the internet. The problem appears to be:

  1. configureSwarm calls mcndockerclient.CreateContainer.
  2. mcndockerclient.CreateContainer calls docker.PullImage.
  3. If docker.PullImage fails, the whole operation fails and the container is not created.