This document contains instructions on how to produce docker images for the project.
- Get a clean Raspbian installation on your Raspberry PI
- Install docker (source)
curl -fsSL get.docker.com -o get-docker.sh && sh get-docker.sh
- Setup to run without sudo:
sudo groupadd docker
sudo gpasswd -a $USER docker
- Logout and log back in.
- Enable the Docker Service
sudo systemctl enable docker
- Start the Docker Service
sudo systemctl start docker
- Sign into Docker
docker login -u <username> -p <password>
Build the project on the dev/ci machine and build the image on the Raspberry PI
Prerequisites:
- Follow the steps above to setup a Raspberry PI with docker.
Steps:
- On your Dev Machine
- Run a build and package it into a
.tar.gz
file.npm run build:tar:docker
- Rsync the tar file into the Raspberry PI
rsync --progress ./temp/output.tar.gz pi@{your_pi_ip_address}:/home/pi
- Run a build and package it into a
- On the Raspberry PI
- Unpack the
.tar.gz
mkdir output
tar xzf ./output.tar.gz -C output
- Build the docker image
docker build -t casual-simulation/aux-arm32 -f Dockerfile.arm32 output
- Unpack the
Build the entire project on the Raspberry PI
Prerequisites:
- Follow the steps above to setup a Raspberry PI with docker.
- Make sure git is installed
sudo apt-get install git
- Make sure NVM is installed
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
- Make sure to run the commands they indicate so bash knows where to find nvm.
- Make sure Node.js 18.18.2 or later is installed
nvm install node
- Make sure lerna is installed
npm install -g lerna
- Clone the aux repository
git clone https://github.com/casual-simulation/casualos.git
- Setup SSH
- On Server:
ssh-keygen -t rsa -b 4096 -C "[email protected]" -m PEM
- Name the key
- Give Passphrase or Skip
- Confirm Passphrase or Skip
cat /path/to/your/key.pub
- Copy the key
- On Agent (Pi):
sudo nano ~/.ssh/authorized_keys
- Paste in your public key
- On Server:
Steps:
- Pull the latest
master
git pull
- Run a build
npm run bootstrap && npm run build:docker:arm32