docker 安装运行redis镜像

1、docker run --name redis-6379 -p 6379:6379 -d redisUnable to find image 'redis:latest' locallylatest: Pulling from library/redisc4bb02b17bb4: Pull complete 58638acf67c5: Pull com...
1、docker run --name redis-6379 -p 6379:6379 -d redis
Unable to find image 'redis:latest' locally
latest: Pulling from library/redis
c4bb02b17bb4: Pull complete 
58638acf67c5: Pull complete 
f98d108cc38b: Pull complete 
83be14fccb07: Pull complete 
5d5f41793421: Pull complete 
ed89ff0d9eb2: Pull complete 
Digest: sha256:0e773022cd6572a5153e5013afced0f7191652d3cdf9b1c6785eb13f6b2974b1
Status: Downloaded newer image for redis:latest
d44747e139652e3ca740a28b1d471f6f03b687ff0756bccb9e24a0d173208074
2、[root@JD ~]# sudo docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
redis               latest              1e70071f4af4        5 weeks ago         107MB
hello-world         latest              f2a91732366c        8 weeks ago         1.85kB
3、[root@JD ~]# docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                    NAMES
d44747e13965        redis               "docker-entrypoint.s…"   2 minutes ago       Up 2 minutes        0.0.0.0:6379->6379/tcp   redis-6379
4、[root@JD ~]# docker run -it --link redis-6379:redis --rm redis redis-cli -h redis -p 6379
redis:6379> set count 1
OK
redis:6379> get count
"1"
redis:6379> exit
  • 发表于 2018-01-19 15:34
  • 阅读 ( 3575 )
  • 分类:linux

0 条评论

请先 登录 后评论
不写代码的码农
威猛的小站长

124 篇文章

作家榜 »

  1. 威猛的小站长 124 文章
  2. Jonny 65 文章
  3. 江南烟雨 36 文章
  4. - Nightmare 33 文章
  5. doublechina 31 文章
  6. HJ社区-肖峰 29 文章
  7. 伪摄影 22 文章
  8. Alan 14 文章