Dockerイメージのビルド
docker build -t sshd .
Dockerコンテナを起動する
docker run -itd -p 22:22 sshd
上記コンテナにsshで接続する(rootのパスワードは password )
> ssh root@localhost
root@localhost's password: password
Welcome to Ubuntu 18.04.6 LTS (GNU/Linux 5.10.16.3-microsoft-standard-WSL2 x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
This system has been minimized by removing packages and content that are
not required on a system that users do not log into.
To restore this content, you can run the 'unminimize' command.
The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.
root@873717cbf7f8:~#