docker / machine

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

Provisioning fails when the default shell for root is non-POSIX (e.g. fish) [generic-driver] #3409

Open niieani opened 8 years ago

niieani commented 8 years ago

The shell for root was set at /usr/bin/fish. Here's the output of docker-machine create -d generic (...):

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: Something went wrong running an SSH command!
command : sudo hostname worker && echo "worker" | sudo tee /etc/hostname
err     : exit status 127
output  : Unsupported use of '&&'. In fish, please use 'COMMAND; and COMMAND'.
fish: sudo hostname worker && echo "worker" | sudo tee /etc/hostname
                                 ^

The workaround is to temporarily change root's shell back to /bin/bash using the chsh command.

Additionally, docker-machine didn't clean up after the failed creation and I had to manually run docker-machine rm worker to remove the leftovers and start over.

sullrich84 commented 4 years ago

Also ran into this.

Running pre-create checks...
Creating machine...
(wdb) 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: ssh command error:
command : sudo hostname wdb && echo "wdb" | sudo tee /etc/hostname
err     : exit status 127
output  : fish: Unsupported use of '&&'. In fish, please use 'COMMAND; and COMMAND'.
sudo hostname wdb && echo "wdb" | sudo tee /etc/hostname