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

docker-machine: adding an existing docker host to docker machine (mac osx) #4621

Open programingnotes opened 5 years ago

programingnotes commented 5 years ago

Given that your docs start that If docker is not running on the host, it is installed automatically, the expectation is that running the command:

docker-machine create \
  --driver generic \
  --generic-ip-address=xxx.xxx.xxx.xxx \
  --generic-ssh-key path_to_ssh_key \
  --generic-ssh-user dockermachineuser \
  somerandomhost

on a host already running docker will not result in an error indicating that docker-machine was attempting to install docker as the error below shows:

Running pre-create checks...
Creating machine...
(somerandomhost) Importing SSH key...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with ubuntu(systemd)...
Installing Docker...
Error creating machine: Error running provisioning: error installing docker:

and no further insights/error message provided by docker-machine.

A 2nd attempt results in this error:

Running pre-create checks...
Creating machine...
(somerandomhost) Importing SSH key...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with ubuntu(systemd)...
Error creating machine: Error running provisioning: Error running "DEBIAN_FRONTEND=noninteractive sudo -E apt-get install -y  curl": ssh command error:
command : DEBIAN_FRONTEND=noninteractive sudo -E apt-get install -y  curl
err     : exit status 255
output  : 

Yet, I successfully run DEBIAN_FRONTEND=noninteractive sudo -E apt-get install -y curl on the host in question as the result below shows:

user@somerandomhost:~$ DEBIAN_FRONTEND=noninteractive sudo -E apt-get install -y  curl
Reading package lists... Done
Building dependency tree       
Reading state information... Done
curl is already the newest version (7.58.0-2ubuntu3.5).
The following package was automatically installed and is no longer required:
  grub-pc-bin
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.

Please see related issues:

karpulix commented 4 years ago

Maybe, container-selinux wasn't installed on a remote machine or you had other trouble. I recommend use --debug or -D for show verbose log.