OK found it.
Create a file called PKI.conf and add
```
[CA]
pki_random_serial_numbers_enable = True
```
in the dockerfile:
COPY pki.conf /etc/pki/pki.conf
in docker-compose under environment in IPA_SERVER_INSTALL_OPTS add:
--pki-config-override=/etc/pki/pki.conf