You can also get docker-compose working if you define the subnet CIDR in your docker compose file:
networks:
your-network:
ipam:
config:
- subnet: 172.16.238.0/24
gateway: 172.16.238.1
Another option: create first the network with the subnet CIDR and then specify in the docker compose file that you want to use this network:
docker network create your-network --subnet 172.24.24.0/24
In your docker compose file:
networks:
your-network:
external: true