Hi want to create a docker image for setting up the AEM instance, wherein I would also add users and groups via that docker image only.
Any pointers recommended
As of AEM 6.5, Docker/containerization is not supported officially. That being said, It might be supported in the future. Check  for supported platforms.
 https://helpx.adobe.com/experience-manager/6-5/sites/deploying/using/technical-requirement s.html#
If you have a static user and group list, you can package them up and keep it in nexus / S3. You can pull in and install this package by executing a cURL command on post image pick up.
Pertaining to what nirmaljosehere mentioned, you can package access rights easily using the ACS Commons ACL Packager
If you don't already have it in place, consider implementing LDAP integration to ensure consistent user rights across multiple AEM instances.