BalenaOS https://www.balena.io/os has been designed to include the minimal set of required components to reliably support operation of the Docker engine in embedded scenarios.
It is part of a more complete architecture:
I adapted the example below for a Raspberry Pi Zero 2 W… basically, the steps are similar
Get Started with balenaCloud using Raspberry Pi 3 and Node.js - Balena Documentation
Toit - high-level software platform for the ESP32
Toit is a modern high-level language designed specifically for microcontrollers. It is open source and the language implementation consists of the compiler, virtual machine, and standard libraries that together enable Toit programs to run on an ESP32.
Toit is optimized for live reloading on your microcontroller. Your code runs incrementally as you write it and you get instant feedback. Push changes over your local WiFi in two seconds and reserve your USB cable for charging your phone. You iterate quickly, learn fast, and build better things.