Using this repo files we can build CentOS 8 with SSHD image, Dockerfiles. This repo also included docker-compose file we can start the continer with SSH port 2222 on the host.
ssh-keygen -N '' -t ed25519 -f ~/.ssh/id_ed25519 -C "Secure Key"
authorized_keys
file.cp ~/.ssh/id_ed25519.pub ~/.ssh/authorized_keys
docker-compose up
ssh -i ~/.ssh/id_ed25519 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@$IP -p 2222