samoht / docker-extension-ocaml

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Create Docker Desktop extensions in OCaml

Usage

Install Docker extension: https://docs.docker.com/desktop/extensions/

To try it:

$ docker extension install tarides/hello

How it works

UI

The ui/ code runs in the same process as Docker for Desktop electron UI. It is compiled to Javascript with js_of_ocaml and hot-loaded by the docker extension command.

ui/dd.ml is a very minimal binding to the Docker Desktop Client API. It's using the wonderful Brr.

VM

The vm/ code runs inside the Linux VM, as a container. It uses a slighlty modified version of Dream that allows to start HTTP servers listening on Unix domain sockets. docker extension starts the container in the VM and connects the relevant sockets so that the UI can talk to the backend using REST calls.

About


Languages

Language:OCaml 55.8%Language:Dockerfile 35.4%Language:HTML 8.9%