From e65270ca47ce3c456735144f19fea94fe36eaac1 Mon Sep 17 00:00:00 2001 From: Alex Berry Date: Sat, 25 Jul 2020 18:35:35 +0100 Subject: [PATCH] More WIP --- README.md | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 86 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index aa07ea2..1fc9ec7 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This guide will walk you through how to set up smokeping on a raspberry pi using ### Download Ubuntu Image -In our example we're using a pi 3, so we'll go and grab their Ubuntu install image from [here](https://ubuntu.com/download/raspberry-pi). +In our example we're using a pi 3, so we'll go and grab their Ubuntu install image from [here](https://ubuntu.com/download/raspberry-pi). When choosing the image, I recommend using 64 bit. ### Install Etcher @@ -65,17 +65,100 @@ chpasswd: hostname: smokepi ``` -Optionally you could change the default password from _ubuntu_ to _password1_ by changing it to this instead: +Optionally you could change the default user from _ubuntu_ to _adam_ and the default password from _ubuntu_ to _password1_ by changing it to this instead: ``` chpasswd: expire: true list: - - ubuntu:password1 + - adam:password1 hostname: smokepi ``` +### First boot + +Once the pi has booted, we must wait for it to stop installing updates before we can continue. To check this, run the following command: + +```bash +while true; do date; ps aux | grep unattended; sleep 5; done +``` + +This will start a never-ending command that will print all processes matching "unattended" back to the console. When updates are complete, it should simply return two lines that match. + +### Install Docker + +This section was taken from docker's own documentation available [here](https://docs.docker.com/engine/install/ubuntu/). + +#### Install pre-requisites + +First we must install the packages that Ubuntu needs in order to configure the docker repository: + +```bash +sudo apt-get install \ + apt-transport-https \ + ca-certificates \ + curl \ + gnupg-agent \ + software-properties-common +``` + +#### Add Docker GPG key + +Next we must install Docker's GPG key so that your pi trusts the docker packages it is about to install: + +```bash +curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - +``` + +#### Add Docker repositories + +Now we will install the docker packages. If you installed 64 bit Ubuntu (recommended), run: +```bash +sudo add-apt-repository \ + "deb [arch=arm64] https://download.docker.com/linux/ubuntu \ + $(lsb_release -cs) \ + stable" +``` + +If you installed 32 bit Ubuntu, run: +```bash +sudo add-apt-repository \ + "deb [arch=armhf] https://download.docker.com/linux/ubuntu \ + $(lsb_release -cs) \ + stable" +``` + +#### Install Docker packages + +Now we must install docker itself with the following commands: + +```bash +sudo apt update +sudo apt install docker-ce docker-ce-cli containerd.io +``` + +#### Add ubuntu user to docker groups + +Now we must add the _ubuntu_ user to the _docker_ group. Doing this ensures that you can run the `docker` command without prefixing it with `sudo`: + +```bash +usermod -aG docker ubuntu +``` + +Once this is done you will need to disconnect and reconnect your ssh connection in order for your user's group membership to be picked up. + +_If you changed the username in the [user-data](#user-data), change `ubuntu` for whichever username you chose._ + +### Test that docker is working + +Finally you should check that docker is up and running by running `docker ps`. Below is what the output should look like when running the command: + +```bash +ubuntu@smokepi:~/ $ docker ps +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +``` + #### Clear graphs ``` sudo rm -rf /opt/smokeping/data/*