I’ve recently decided to start self hosting a few services for myself and whilst I’m likely to use cloud services for this kind of stuff in future, I wondered if I could do anything with my dust-covered RPi3. Turns out: yes, I could. Read on for more!
I looked into running Docker on the Pi a few years ago, and at the time, docker-engine didn’t run on ARM processors. When I looked recently, I found Hypriot - a pared-back version Raspbian, which runs docker-engine out of the box.
I’m putting to record the steps I took, as initially I stumbled a few times with wifi connectivity. If I never need to do this again, at least it’ll be there to help someone else.
Steps
Download image and unzip
curl -O https://github.com/hypriot/image-builder-rpi/releases/download/v1.12.0/hypriotos-rpi-v1.12.0.img.zip && unzip hypriotos-rpi-v1.12.0.img.zip
Write image to SD card (assuming
/dev/sdc
):dd if=hypriotos-rpi-v1.12.0.img of=/dev/sdc bs=1M
Generate an encrypted WPA passphrase for wifi network:
wpa_passphrase <my_ssid> <my_passphrase>
This will return the encrypted passphrase:network={ ssid="my_ssid" #psk="my_passphrase" psk=4ca2ade13a230e81b52f011c83ee4d7ac3602cf29908ce239fe2dcc37b345f0e }
On the SD card’s boot partition (named HyriotOS), edit the file
user-data
Uncomment the Wifi section
Set the ISO country code appropriately, remove any non-essential network settings and add the WPA info from step 3:
write_files: - content: | allow-hotplug wlan0 iface wlan0 inet dhcp wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf iface default inet dhcp path: /etc/network/interfaces.d/wlan0 - content: | country=GB ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev update_config=1 network={ ssid="virginmedia0643874" psk=4ca2ade13a230e81b52f011c83ee4d7ac3602cf29908ce239fe2dcc37b345f0e key_mgmt=WPA-PSK } path: /etc/wpa_supplicant/wpa_supplicant.conf
Ensure the wifi is activated - uncomment the section at the end:
- 'ifup wlan0'
Remove the SD and plug it into the Pi
Log on to the pi with the default credentials
user: pirate password: hypriot
The above steps were loosely based on this page on Hypriot’s site.