16GB RAM is the minimum for Xcode and Docker on a MacBook Air.
Get 16GB. 8GB will hurt you daily.
Xcode is a memory hog by itself — the compiler, the simulator, the indexing engine all want their share. Add Docker running a few containers (databases, services, whatever) and you’re easily over 8GB before you even open Safari. macOS will start swapping to the SSD, which slows everything down and wears the drive faster.
The real-world difference is simple: with 16GB you keep working. With 8GB you wait — for apps to relaunch, for the beach ball to stop, for your containers to respond. If you’re doing anything beyond toy projects, 8GB is not enough.
Your time is worth more than the upgrade cost.