google code prettify

2016年9月30日 星期五

用docker啟動redis服務


1、先至docker hub上找到redis頁面
https://hub.docker.com/_/redis/

2、依網頁上的指令pull redis
開啟Terminal,輸入「docker pull redis」










3、找到image id
輸入「docker images」















4、啟動redis
輸入「docker run --name redis -d -p 6379:6379 ${imageID}」
指令中的${imageID}記得要換成自己的image id,像圖片中的redis image id是1aa84b1b434e
所以我本機輸入的指令為「docker run --name redis -d -p 6379:6379 1aa84b1b434e」





Reference:
https://hub.docker.com/_/redis/
http://stackoverflow.com/questions/31889163/cannot-connect-to-redis-running-as-container-with-boot2docker

沒有留言:

張貼留言