I have launched confluent kafka using below docker compose file and its working as expected.
https://github.com/confluentinc/cp-all-in-one/blob/6.0.1-post/cp-all-in-one/d