Sources.list is over written during build


I’m trying to deploy a simple Ubuntu 20.04 box in a private network. I have an inline script which replaces and Everything works fine when I provision the box but for some reason mid build the file is replaced and the default values are re applied.

Any way around this ? I’m guessing it has to do with the cloud-init but I’m not 100% sure where to look.