The image has an init script which replaces SSH_PORT variable in the /etc/sshd_config file while the container is coming up.
docker build -t test .
docker run -d -p 8080:8080 -p 2222:2222 -e SSH_PORT=2222 --name test test
ssh root@localhost -p 2222