Repository: dockerfile/redis Branch: master Commit: 1b34d5b8adf8 Files: 3 Total size: 3.2 KB Directory structure: gitextract_tgdrbe47/ ├── Dockerfile ├── LICENSE └── README.md ================================================ FILE CONTENTS ================================================ ================================================ FILE: Dockerfile ================================================ # # Redis Dockerfile # # https://github.com/dockerfile/redis # # Pull base image. FROM dockerfile/ubuntu # Install Redis. RUN \ cd /tmp && \ wget http://download.redis.io/redis-stable.tar.gz && \ tar xvzf redis-stable.tar.gz && \ cd redis-stable && \ make && \ make install && \ cp -f src/redis-sentinel /usr/local/bin && \ mkdir -p /etc/redis && \ cp -f *.conf /etc/redis && \ rm -rf /tmp/redis-stable* && \ sed -i 's/^\(bind .*\)$/# \1/' /etc/redis/redis.conf && \ sed -i 's/^\(daemonize .*\)$/# \1/' /etc/redis/redis.conf && \ sed -i 's/^\(dir .*\)$/# \1\ndir \/data/' /etc/redis/redis.conf && \ sed -i 's/^\(logfile .*\)$/# \1/' /etc/redis/redis.conf # Define mountable directories. VOLUME ["/data"] # Define working directory. WORKDIR /data # Define default command. CMD ["redis-server", "/etc/redis/redis.conf"] # Expose ports. EXPOSE 6379 ================================================ FILE: LICENSE ================================================ The MIT License (MIT) Copyright (c) Dockerfile Project Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: README.md ================================================ ## Redis Dockerfile This repository contains **Dockerfile** of [Redis](http://redis.io/) for [Docker](https://www.docker.com/)'s [automated build](https://registry.hub.docker.com/u/dockerfile/redis/) published to the public [Docker Hub Registry](https://registry.hub.docker.com/). ### Base Docker Image * [dockerfile/ubuntu](http://dockerfile.github.io/#/ubuntu) ### Installation 1. Install [Docker](https://www.docker.com/). 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` (alternatively, you can build an image from Dockerfile: `docker build -t="dockerfile/redis" github.com/dockerfile/redis`) ### Usage #### Run `redis-server` docker run -d --name redis -p 6379:6379 dockerfile/redis #### Run `redis-server` with persistent data directory. (creates `dump.rdb`) docker run -d -p 6379:6379 -v :/data --name redis dockerfile/redis #### Run `redis-server` with persistent data directory and password. docker run -d -p 6379:6379 -v :/data --name redis dockerfile/redis redis-server /etc/redis/redis.conf --requirepass #### Run `redis-cli` docker run -it --rm --link redis:redis dockerfile/redis bash -c 'redis-cli -h redis'