Extension manager: allow manually uploading a docker image
We'd need to add an API endpoint for loading an image (like we do in version-chooser), which then imports it into docker, before doing the normal custom extension registration process.
I propose we add a "manual upload" option to the custom registration interface for now, but once #2768 is complete there may be some other relevant interface options available too (e.g. if we want to support users installing official extension versions offline then we'd presumably want a streamlined way for them to be uploaded without needing custom registration, and possibly with key-sign verification to confirm that they're actually legit images)
As an interim workaround it should be possible already to:
- Upload the extension's docker image
.tarball to the BlueOS device, using either the File Browser or ssh- Probably makes sense to put it in the
/usr/blueos/extensionsfolder (justextensionsin the File Browser)
- Probably makes sense to put it in the
- Use the BlueOS Terminal to
docker importthe image (may need tored-pillto be able to access thedockerCLI) - Tag the image with a tag that doesn't exist in the online registry
- I'm unsure whether it will already have a tag when it's imported
- Use the custom extension registration process to register that image + tag combo
As an alternative to uploading a tarball, I prefer to use the docker engine on the rpi directly.
On your development machine do this once to create a context:
docker context create blueos
docker context update blueos --description "Docker Engine running on BlueOS"
docker context update blueos --docker "host=ssh://blueos.local"
docker --context=blueos buildx create --driver=docker-container --name=blueos-builder
docker --context=blueos buildx use blueos-builder --default
Switch your context (before you run docker commands) with:
docker context use blueos
Get all extension containers (i.e. name starts with extension) into a local compose file with
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock ghcr.io/red5d/docker-autocompose $(docker ps -aq --filter name=extension) > compose.yaml
Remove services from that file which you don't want to edit (e.g. blueos-core).
On the service you want to edit, replace the image: ... value with build: /path/to/folder/containing/dockerfile/
Optionally, normalize your compose file with:
docker config --output compose.yaml
then edit and run with docker compose up --build