一、创建并运行容器
docker run -d -it --name redis d4f259423416
PS C:\Users\K-Jso> docker images -a REPOSITORY TAG IMAGE ID CREATED SIZE docker4w/nsenter-dockerd latest cae870735e91 4 months ago 187kB hub.c.163.com/library/php 7.1 6cd3037a948f 6 months ago 371MB hub.c.163.com/library/oraclelinux latest 9fe41720f939 7 months ago 229MB hub.c.163.com/library/redis 4.0.1 d4f259423416 8 months ago 106MB hub.c.163.com/library/nginx latest 46102226f2fd 11 months ago 109MB hub.c.163.com/library/mysql 5.6 0977f3a915e5 11 months ago 298MB PS C:\Users\K-Jso> docker run -d -it --name redis d4f259423416
二、进入容器
docker exec -it e9cf9f36b1f737d999153d1b0e98f3084d5f63e12e0f92f13b7c79242cc95420 /bin/sh # redis-cli 127.0.0.1:6379>