Skip to content

Getting Started on a Raspberry Pi

Ryan Schlesinger edited this page Mar 6, 2019 · 12 revisions

If you're new to docker, here's a great way to get started.

On mac (or any computer really):

  • Insert rasp pi sd card into mac
  • brew install pv ssh-copy-id
  • curl -LO https://github.com/hypriot/flash/releases/download/2.3.0/flash
  • chmod +x flash
  • sudo mv flash /usr/local/bin/flash

Create cloud-config.yml

#cloud-config
hostname: black-pearl
manage_etc_hosts: true

users:
  - name: pirate
    gecos: "Hypriot Pirate"
    sudo: ALL=(ALL) NOPASSWD:ALL
    shell: /bin/bash
    groups: users,docker,video
    plain_text_passwd: hypriot
    lock_passwd: true
    ssh_pwauth: false
    ssh-authorized-keys:
      - CHANGEME

package_upgrade: true

# Static IP address
write_files:
  - content: |
      persistent
      # static IP configuration:
      # CHANGEME: update for your network
      interface eth0
      static ip_address=192.168.1.2/24
      static routers=192.168.1.1
      static domain_name_servers=192.168.1.1 8.8.8.8
    path: /etc/dhcpcd.conf
runcmd:
  # Pickup the hostname changes
  - 'systemctl restart avahi-daemon'
  • flash -u cloud-config.yml https://github.com/hypriot/image-builder-rpi/releases/download/v1.10.0/hypriotos-rpi-v1.10.0.img.zip (or latest release)
  • When complete, install sd card into rpi and power on

On rpi:

  • cd /opt
  • sudo git clone https://github.com/ryansch/docker-unifi-rpi unifi
  • sudo systemctl enable /opt/unifi/contrib/unifi.service
  • docker pull ryansch/unifi-rpi:latest (For download and extract progress)
  • sudo systemctl start unifi

On mac:

Unifi Image Upgrade

  • docker pull ryansch/unifi-rpi:latest
  • sudo systemctl restart unifi

Hypriot Upgrade

  • docker run -it --rm -v unifi_config:/config -v $(pwd):/backup --name=copy -w /config alpine:latest tar -zcf /backup/unifi_config.tar.gz .
  • Copy the tarball from the pi to another system
  • Run the flash and setup instructions above stopping before starting unifi.
  • Copy the tarball from another system back to the pi
  • docker volume create --name unifi_config
  • docker run -it --rm -v unifi_config:/config -v $(pwd):/backup --name=copy -w /config alpine:latest tar -zxf /backup/unifi_config.tar.gz .
  • Volume is now populated from backup. Continue with starting unifi.
Clone this wiki locally
You can’t perform that action at this time.