コンテナIDを確認する
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f61dccc8a165 redis:3.2.4 "docker-entrypoint..." 10 minutes ago Up 9 minutes 0.0.0.0:6379->6379/tcp devserverdocker_cache_1
fdcc61821a48 mysql:5.6 "docker-entrypoint..." 10 minutes ago Up 9 minutes 0.0.0.0:3306->3306/tcp devserverdocker_db_1
a7378ae08afc deangiberson/aws-dynamodb-local "/usr/bin/java -Dj..." 10 minutes ago Up 9 minutes 0.0.0.0:8000->8000/tcp devserverdocker_dynamo_1
コンテナに入る
$ docker exec -it fdcc61821a48 /bin/bash
root@fdcc61821a48:/#
root@fdcc61821a48:/# exit
※ docker exec -it
だと docker attach
と違って、exitしてもコンテナは終了しない