http://wiki.friendlyarm.com/wiki/index.php/NanoPi_NEO2#UbuntuCore_16.04
Follow instructions to download image - nanopi-neo2_sd_friendlycore-xenial_4.14_arm64_20181011.img
Write it to SD card (8 GB Min) with Win32 disk imager and put it into NanoPi. Connect to network, boot up and login with root/fa
Then follow instructions to first set up NanoPI.
https://gist.github.com/gintsgints/8d049cf122c1f2e49c5805dbce0d4653
https://docs.docker.com/install/linux/docker-ce/ubuntu/
# Update packages first
sudo apt-get update
sudo apt-get upgrade -y
# Install/check required packages
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
# Add & verify key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
# Add Repo
sudo add-apt-repository \
"deb [arch=arm64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
# Do install
sudo apt-get update
sudo apt-get install -y docker.io
And set docker to be started by default:
systemctl enable docker
Also if you want execute docker commands as normal user, add yourself to docker gorup (will be aiviable after restart):
sudo usermod -a -G docker username
Make user ass sudoer without asking password:
sudo vim /etc/sudoers
# Add this:
username ALL=(root) NOPASSWD: ALL
And then from host machine you can do:
docker-machine -D create --driver generic --generic-ip-address=192.168.0.151 --generic-ssh-key ~/.ssh/id_rsa --generic-ssh-user=username node1
Now you can access your remote node1 within:
eval $(docker-machine env node1)
try:
docker node ls
docker swarm init
Then you will get command to join your swarm from other nodes, like:
docker swarm join --token your_token_here 192.168.0.151:2377
To add a manager to this swarm, run 'docker swarm join-token manager' and follow the instructions
Install apps to your swarm remotely you have to move your machine configs to remote machine. You can do it with machine-share - https://github.com/bhurlow/machine-share
# Install nodejs
sudo apt-get install nodejs
sudo apt-get install npm
sudo ln -s `which nodejs` /usr/bin/node
# Install machine-share
sudo npm install -g machine-share
# Export machine
machine-export node1