在docker中安裝redis
使用命令行安裝redis
- 下載並解壓
wget http://download.redis.io/releases/redis-3.2.6.tar.gz
tar -xvf redis-3.2.6.tar.gz
cd redis-3.2.6.tar.gz
2.編譯安裝
make
- 啟動redis服務
// 啟動redis服務
src/redis-server &
// 連接redis
src/redis-cli
set test "hello"
get test
使用Dockerfile
FROM lack/basic:latest
WORKDIR /root
RUN wget http://download.redis.io/releases/redis-3.2.6.tar.gz
RUN tar -xvf redis-3.2.6.tar.gz
WORKDIR redis-3.2.6
RUN make
EXPOSE 6379
CMD /root/redis-3.2.6/src/redis-server &
