>docker container run -it ubuntu
Unable to find image 'ubuntu:latest' locally
latest: Pulling from library/ubuntu
5a7813e071bf: Download complete
Digest: sha256:72297848456d5d37d1262630108ab308d3e9ec7ed1c3286a32fe09856619a782
Status: Downloaded newer image for ubuntu:latest
root@febcd11becc6:/#
> docker container run -itd ubuntu
// docker container run -it -d ubuntuと同じ意味、省略すると上記のコマンドになる。
737f725fe36aed132137a5345ad60437bd8a77c641559722a5a26fe758a87a0b
> docker container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9b5f5f5fe626 ubuntu "/bin/bash" 2 minutes ago Up 2 minutes cranky_yalow
// バックグラウンドでコンテナが起動していることがわかる。
> docker container attach 737f725fe36a
root@737f725fe36a:/#
// コンテナ内に入ることが出来た。