build:
context: .
dockerfile: Dockerfile-redis
args:
- TZ=Asia/Shanghai
- PASSWORD=admin@123
Dockerfile-redis
FROM redis:5.0
ARG TZ=Asia/Shanghai
ARG PASSWORD=admin@123
ENV TZ=$TZ \
PASSWORD=$PASSWORD \
LANG=C.UTF-8
COPY etc/redis/redis.conf /usr/local/etc/redis.conf
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone \
&& chmod 644 /usr/local/etc/redis.conf \
&& sed -i "s/requirepass admin@123/requirepass $PASSWORD/g" /usr/local/etc/redis.conf \
&& sed -i "s/# maxmemory-policy noeviction/maxmemory-policy volatile-random/g" /usr/local/etc/redis.conf \
&& grep requirepass /usr/local/etc/redis.conf \
&& ls -al /usr/local/etc/redis.conf
EXPOSE 6379
CMD [ "redis-server", "/usr/local/etc/redis.conf" ]
ps、ping、telnet命令Content type
Image
Digest
sha256:c5393b1ed…
Size
41.5 MB
Last updated
over 3 years ago
docker pull nonsenselive/redis:v1.0.2