Skip to content

Instantly share code, notes, and snippets.

@gintsgints
Created March 8, 2018 07:41
Show Gist options
  • Save gintsgints/f8403167b0bcdf7192d19ef66a29130e to your computer and use it in GitHub Desktop.
Save gintsgints/f8403167b0bcdf7192d19ef66a29130e to your computer and use it in GitHub Desktop.

Prepeare

Create user:

sudo adduser username

Add user to ssh users

usermod -a -G ssh username

Add user rights to sudo without password

You can remove this later:

sudo vim /etc/sudoers

and add

username ALL=(root) NOPASSWD: ALL

Key auth

ssh-copy-id username@node

Check how this works

Should be able to do this without entering password.

ssh 'username@node'
sudo su -

Create machine

docker-machine -D create --driver generic --generic-ip-address=<node_ip_address_here> --generic-ssh-key ~/.ssh/id_rsa --generic-ssh-user=username --engine-storage-driver=overlay2 node

After you can init

To see environment variables for config

docker-machine env node

do configuration

eval $(docker-machine env node)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment