2023-12-20 13:04:23 -07:00
|
|
|
Alpine Toolbox
|
|
|
|
==============
|
|
|
|
|
|
|
|
This is a little Alpine container I run to provide SSH logins with a bunch of tools.
|
|
|
|
|
|
|
|
|
|
|
|
Persistence
|
|
|
|
----------
|
|
|
|
|
|
|
|
If `/mnt/toolbox` exists,
|
|
|
|
toolbox will persist installed packages and system changes
|
|
|
|
by using methods that already exist in arch.
|
|
|
|
|
|
|
|
* [Alpine Local Backup](https://wiki.alpinelinux.org/wiki/Alpine_local_backup)
|
|
|
|
is pre-configured to use `/mnt/toolbox/lbu`.
|
|
|
|
* [Local APK cache](https://wiki.alpinelinux.org/wiki/Local_APK_cache)
|
|
|
|
is pre-configured to use `/mnt/toolbox/apk`.
|
|
|
|
|
|
|
|
It's important to `lbu` that your machine have a hostname.
|
|
|
|
If you change hostnames,
|
|
|
|
you will need to rename files in `/mnt/toolbox/lbu`.
|
|
|
|
|
|
|
|
```
|
|
|
|
podman run \
|
|
|
|
--hostname toolbox \
|
|
|
|
--volume /path/to/toolbox:/mnt/toolbox \
|
|
|
|
git.woozle.org/neale/toolbox
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
First Run
|
|
|
|
---------
|
|
|
|
|
|
|
|
You may want to `podman exec` into the container,
|
|
|
|
in order to edit `/etc/doas.conf`
|
|
|
|
set up user accounts,
|
|
|
|
and/or install ssh `authorized_keys`.
|
|
|
|
|
|
|
|
Once set up,
|
|
|
|
you should be able to ssh in for most of your needs.
|
|
|
|
|
|
|
|
|
2023-12-20 14:24:48 -07:00
|
|
|
Startup scripts
|
|
|
|
---------------
|
|
|
|
|
|
|
|
The system uses [runit](http://smarden.org/runit/).
|
|
|
|
If you drop an executable in `/etc/service/*/run`,
|
|
|
|
runit will run it.
|
|
|
|
|
|
|
|
Be sure to `lbu commit` if you're making startup scripts.
|
|
|
|
|
|
|
|
|
2023-12-20 13:07:37 -07:00
|
|
|
Podman vs Docker
|
|
|
|
----------------
|
|
|
|
|
|
|
|
On my diskless Raspberry Pi,
|
|
|
|
Podman takes half as much space on the RAM disk as Docker.
|
|
|
|
So I use Podman.
|
|
|
|
|
|
|
|
You do you.
|
2023-12-20 13:08:21 -07:00
|
|
|
If you like docker better, just type `docker` instead of `podman`.
|
2023-12-20 13:07:37 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
2023-12-20 13:04:23 -07:00
|
|
|
Why This Exists
|
|
|
|
---------------
|
|
|
|
|
2023-12-20 13:09:53 -07:00
|
|
|
I run my home server in Alpine's "diskless mode".
|
2023-12-20 13:04:23 -07:00
|
|
|
The Raspberry Pi uses a MicroSD card,
|
|
|
|
which will "wear out" after many writes.
|
|
|
|
This means my system runs entirely in RAM.
|
|
|
|
|
2023-12-20 13:09:53 -07:00
|
|
|
Once my home server is up,
|
|
|
|
it mounts a 12TB btrfs array.
|
|
|
|
So I run a bunch of containers backed by the disk.
|
|
|
|
|
2023-12-20 13:04:23 -07:00
|
|
|
Running a more robust installation in a container
|
|
|
|
allows me to use my magnetic storage for the larger system,
|
|
|
|
and install and remove packages when I like,
|
|
|
|
without worrying about wearing out the MicroSD card.
|
|
|
|
|
|
|
|
|
|
|
|
Shout Out
|
|
|
|
---------
|
|
|
|
|
|
|
|
Alpine Linux is cool.
|
|
|
|
It provides all the difficult parts of this,
|
|
|
|
I just had to set up some config files.
|
|
|
|
|
|
|
|
The really cool part is that my container works the same way as the host it runs on!
|