For Ansible practice, I wrote this because I wanted an image that can be entered by SSH.
Click here for CentOS7 Click here for CentOS6
Reference Docker 初心者 — ssh で接続できるサーバーを立てる
$ docker build -t ssh_ubuntu14:latest . --no-cache
$ docker run -d -p 2222:22 ssh_ubuntu14:latest
$ ssh-keygen -R [localhost]:2222
$ ssh -p 2222 kabigon@localhost