Sign inSign up

imocence/redis-alpine

By imocence

•Updated over 3 years ago

Based on imocence/alpine mirror build redis server

Image
0

159

imocence/redis-alpine repository overview

⁠Use Dockerfile file content

# Base image
FROM imocence/alpine:3.15

# Image creator
MAINTAINER imocence

ENV REDIS_VER=6.2.9

# Define working directory.
WORKDIR /opt

# Install Redis.
RUN apk add --no-cache redis=$REDIS_VER-r0 && mkdir /opt/conf /opt/data \
&& sed -i 's/bind 127.0.0.1 -::1/#bind 127.0.0.1 -::1/g' /etc/redis.conf \
&& sed -i 's#protected-mode yes#protected-mode no#g' /etc/redis.conf \
&& sed -i 's#dir /var/lib/redis#dir /opt/data#g' /etc/redis.conf

# Define mountable directories.
VOLUME ["/opt/data","/opt/conf"]

# Expose ports.
EXPOSE 6379

# Define default command.
CMD if [ ! -f "/opt/conf/redis.conf" ];then cp /etc/redis.conf /opt/conf; fi && redis-server /opt/conf/redis.conf

⁠Use docker-compose.yml file content

version: '2'
services:
  web:
    image: imocence/redis-alpine:v6.2.9
    container_name: redis
    restart: always
    ports:
      - "6379:6379"
    volumes:
      - ./conf:/opt/conf:rw
      - ./data:/opt/data

Tag summary

Content type

Image

Digest

sha256:1755e82a8…

Size

4 MB

Last updated

over 3 years ago

docker pull imocence/redis-alpine:v6.2.9