Just a linux for some tests, working, and what you need to do in linux.
Set your git the following command.
git config --global core.autocrlf false
Because trailing characters ^M will affect the docker image build.
docker build -t your_image_tag .
docker run -id --name container_name -p 22:22 your_image_tag
docker exec -it container_name /bin/bash
login:root password:root
Enjoy...