树莓派安装Hassio:Docker+Debian9

一:环境配置

  • 到树莓派官网下载最新版的镜像
  • 使用Etcher或者Win32Diskimager刷入系统到SD卡中
  • 刷好后在boot分区内新建一个空白文件,并且命名为 ssh【新版树莓派系统默认不开启ssh】

二:基本配置

  • 修改无线网络连接,主机名,时区,密码等: sudo raspi-config 重启后生效
  • 更换系统的源
    sudo nano /etc/apt/sources.list
deb http://mirrors.aliyun.com/raspbian/raspbian/ jessie main non-free contrib
deb-src http://mirrors.aliyun.com/raspbian/raspbian/ jessie main non-free contrib

【中科大源 deb http://mirrors.ustc.edu.cn/archive.raspberrypi.org/debian/ stretch main ui 】

  • 更换deb源 sudo nano /etc/apt/sources.list.d/raspi.list
    deb http://mirrors.aliyun.com/debian/ stretch main ui
    【中科大源 deb http://mirrors.ustc.edu.cn/archive.raspberrypi.org/debian/ stretch main ui 】
  • 更新sudo apt-get update

  • 允许 apt 通过 HTTPS 使用镜像仓库

sudo apt-get install \
     apt-transport-https \
     ca-certificates \
     curl \
     gnupg2 \
     software-properties-common

三:安装Docker

  • 添加docker官方GPG key

curl -fsSL https://download.docker.com/linux/$(. /etc/os-release; echo "$ID")/gpg | sudo apt-key add -

  • 添加 Docker CE 仓库
echo "deb [arch=armhf] https://download.docker.com/linux/debian \
      $(lsb_release -cs) stable" | \
     sudo tee /etc/apt/sources.list.d/docker.list
  • 安装docker-ce
sudo apt-get update
sudo apt-get install docker-ce -y
sudo usermod -aG docker pi
  • 增加 Docker 仓库镜像
    sudo nano /etc/docker/daemon.json
{
  "registry-mirrors": ["https://registry.docker-cn.com"]
}
  • 使用阿里源加速Docker镜像 http://www.cnblogs.com/atuotuo/p/6264800.html
  • 更换python源
cd ~
mkdir .pip
sudo nano ~/.pip/pip.conf

粘贴以下内容并保存退出

[global]
trusted-host=mirrors.aliyun.com
index-url=http://mirrors.aliyun.com/pypi/simple

四:安装Hassio

  • 更新源列表命令
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get dist-upgrade
  • 安装支持库文件sudo apt-get install bash socat jq - y
  • 拉取Docker UI界面镜像docker pull portainer/portainer:latest
  • 配置安装Docker UI容器
docker run -d -p 9000:9000 --name portainer --restart=always -e TZ="Asia/Shanghai" -v /var/run/docker.sock:/var/run/docker.sock portainer/portainer

然后打开浏览器中输入树莓派IP地址: http://ip:9000
选择本地Docker socket to manage a local Docker engine (not available for Windows Containers (Windows Server 2016))
- 拉取Homeassistant镜像 docker pull homeassistant/armhf-homeassistant:latest
- 拉取Supervisor镜像 docker pull homeassistant/armhf-hassio-supervisor:latest
- 安装hassio切换到root sudo su

curl -sL https://raw.githubusercontent.com/home-assistant/hassio-build/master/install/hassio_install | bash -s -- -m raspberrypi3
  • pi帐号进入,查看hassio-supervisor状态,看是否安装成功 sudo journalctl -fu hassio-supervisor.service
  • 打开浏览器中输入树莓派IP地址: http://ip:8123

配置文件目录


cd /usr/share/hassio

Hassio addon网址

https://github.com/danielperna84/hassio-addons
https://github.com/vkorn/hassio-addons
https://github.com/bestlibre/hassio-addons
https://github.com/gollo/hassio-addons
https://github.com/sunnythaper/sunnys-hassio
https://github.com/HerrHofrat/hassio-addons
https://github.com/balloob/hassio-addon-experiments
https://github.com/home-assistant/hassio-addons-example
https://github.com/ohmer1/hassio-addons
https://github.com/bramkragten/hassio-addons
https://github.com/adamrutt/hassio-addons
https://github.com/frenck/incubator
https://github.com/nalipaz/hassio-addons
https://github.com/odinuge/hassio-addons
https://github.com/hassio-addons/repository

你可能感兴趣的:(Raspberry,HomeAssistant)