Skip to content

Commit 2900c04

Browse files
author
avinb
committed
synced redis docker file
1 parent 3e97a41 commit 2900c04

File tree

3 files changed

+93
-0
lines changed

3 files changed

+93
-0
lines changed

redis/Dockerfile

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#
2+
# Redis Dockerfile
3+
#
4+
#
5+
6+
# Pull base image.
7+
FROM debian:jessie
8+
9+
# Install Redis.
10+
RUN \
11+
cd /tmp && \
12+
wget http://download.redis.io/redis-stable.tar.gz && \
13+
tar xvzf redis-stable.tar.gz && \
14+
cd redis-stable && \
15+
make && \
16+
make install && \
17+
cp -f src/redis-sentinel /usr/local/bin && \
18+
mkdir -p /etc/redis && \
19+
cp -f *.conf /etc/redis && \
20+
rm -rf /tmp/redis-stable* && \
21+
sed -i 's/^\(bind .*\)$/# \1/' /etc/redis/redis.conf && \
22+
sed -i 's/^\(daemonize .*\)$/# \1/' /etc/redis/redis.conf && \
23+
sed -i 's/^\(dir .*\)$/# \1\ndir \/data/' /etc/redis/redis.conf && \
24+
sed -i 's/^\(logfile .*\)$/# \1/' /etc/redis/redis.conf
25+
26+
# Define mountable directories.
27+
VOLUME ["/redisdata"]
28+
29+
# Define working directory.
30+
WORKDIR /redisdata
31+
32+
# Define default command.
33+
CMD ["redis-server", "/etc/redis/redis.conf"]
34+
35+
# Expose ports.
36+
EXPOSE 6379

redis/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) Dockerfile Project
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

redis/README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
## Redis Dockerfile
2+
3+
4+
This repository contains **Dockerfile** of [Redis](http://redis.io/) for [Docker](https://www.docker.com/)'s
5+
6+
### Base Docker Image
7+
8+
* [dockerfile/ubuntu](http://dockerfile.github.io/#/ubuntu)
9+
10+
11+
### Installation
12+
13+
1. Install [Docker](https://www.docker.com/).
14+
15+
2. Download [automated build](https://registry.hub.docker.com/u/dockerfile/redis/) from public [Docker Hub Registry](https://registry.hub.docker.com/): `docker pull dockerfile/redis`
16+
17+
(alternatively, you can build an image from Dockerfile: `docker build -t="dockerfile/redis" github.com/dockerfile/redis`)
18+
19+
20+
### Usage
21+
22+
#### Run `redis-server`
23+
24+
docker run -d --name redis -p 6379:6379 dockerfile/redis
25+
26+
#### Run `redis-server` with persistent data directory. (creates `dump.rdb`)
27+
28+
docker run -d -p 6379:6379 -v <data-dir>:/data --name redis dockerfile/redis
29+
30+
#### Run `redis-server` with persistent data directory and password.
31+
32+
docker run -d -p 6379:6379 -v <data-dir>:/data --name redis dockerfile/redis redis-server /etc/redis/redis.conf --requirepass <password>
33+
34+
#### Run `redis-cli`
35+
36+
docker run -it --rm --link redis:redis dockerfile/redis bash -c 'redis-cli -h redis'

0 commit comments

Comments
 (0)