In our YAML, we use systemd-resolved for DNS resolution, so /etc/resolv.conf becomes a symlink to a path in /run/systemd which is created at boot by systemd-resolved.
If you’re not using systemd-networkd and systemd-resolved in your image, then you’ll need a different solution, such as ifupdown + resolvconf or some other alternatives.
You’re also going to need some kind of network configuration in place for DHCP to run at boot time. In our YAML we do that by adding a /etc/systemd/network/enp5s0.network file.