Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save gadieichhorn/4e6cf5f679282b832a83316db5e7ecaf to your computer and use it in GitHub Desktop.
Save gadieichhorn/4e6cf5f679282b832a83316db5e7ecaf to your computer and use it in GitHub Desktop.

#Setting up Docker Machine on Raspberry PI

  1. SSH into the pi and install docker with curl -sSL https://get.docker.com | sh (If we let Machine try to install the Docker daemon it will fail.)
  2. Change the OS's ID so Docker Machine won't throw errors. sudo nano /etc/os-release and change the line that says ID=raspbian to ID=debian
  3. From a new terminal window run docker-machine create --driver generic --generic-ip-address YOUR-PIS-IP --generic-ssh-key ~/.ssh/id_rsa --generic-ssh-user pi --engine-storage-driver overlay2 MACHINE-NAME
@gadieichhorn
Copy link
Author

gadieichhorn commented Jan 31, 2018

docker-machine create --driver generic --generic-ip-address rpi-01.local --generic-ssh-key ~/.ssh/id_rsa --generic-ssh-user pirate --engine-storage-driver overlay2 rpi-01

docker-machine create --driver generic --generic-ip-address rpi-02.local --generic-ssh-key ~/.ssh/id_rsa --generic-ssh-user pirate --engine-storage-driver overlay2 rpi-02

docker-machine create --driver generic --generic-ip-address rpi-03.local --generic-ssh-key ~/.ssh/id_rsa --generic-ssh-user pirate --engine-storage-driver overlay2 rpi-03

@gadieichhorn
Copy link
Author

Only works with IP. rpi name is not working

@gadieichhorn
Copy link
Author

using hypriot image 1.9

$ docker-machine create --driver generic --generic-ip-address 10.0.0.16 --generic-ssh-key ~/.ssh/id_rsa --generic-ssh-user pirate --engine-storage-driver overlay2 rpi-03
Running pre-create checks...
Creating machine...
(rpi-03) 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 debian...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Checking connection to Docker...
Docker is up and running!
To see how to connect your Docker Client to the Docker Engine running on this virtual machine, run: docker-machine env rpi-03

docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
rpi-01 - generic Stopped Unknown
rpi-02 - generic Stopped Unknown
rpi-03 - generic Running tcp://10.0.0.16:2376 v18.04.0-ce

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment