Raspberry Pi OS:
Write Image to SDcard. Add empty file named 'ssh' to sdcard root.
Ref.: https://hackernoon.com/raspberry-pi-headless-install-462ccabd75d0
Alpine Linux:
Extract Image to local disk. Create apkovl.tar.gz overlay file that sets up networking and ssh.
Put file to the root of the sdcard.
In the same way it's possible to create a apkovl.tar.gz overlay file that runs setup-alpine with pre-made answerfile.
Ref.: https://wiki.alpinelinux.org/wiki/Raspberry_Pi_-_Headless_Installation
Ref.: https://docs.alpinelinux.org/user-handbook/0.1a/Installing/setup_alpine.html#_answer_files