The latter can be done by booting into another distro and kexec'ing into your own kernel and performing the Installation afterward from memory. See also nixos-anywhere for a practical implementation of this
In the past I've used a script called "alpine-make-vm-image" to run alpine images in digital ocean.
https://github.com/alpinelinux/alpine-make-vm-image
(Maybe that script does some magic to make booting a droplet directly from the image possible. On that I plead ignorance :)