docker - 容器里安装redis
在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 &