forked from road-core/service
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Containerfile.redis
24 lines (19 loc) · 784 Bytes
/
Containerfile.redis
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Use CentOS Stream 9 as the base image
FROM quay.io/centos/centos:stream9
# Install necessary dependencies (gcc, make, etc.) for building Redis from source
RUN yum install -y gcc make wget tar gzip openssl openssl-devel && \
yum clean all && mkdir -p /etc/redis && \
wget https://download.redis.io/releases/redis-7.2.4.tar.gz && \
tar xzf redis-7.2.4.tar.gz -C /etc/redis --strip-components=1 && \
rm redis-7.2.4.tar.gz && \
chmod 770 /var/run
# Change working directory to the extracted Redis source code directory
WORKDIR /etc/redis
# Build Redis from source
RUN make BUILD_TLS=yes && \
make install && \
chmod -R +r /etc/redis
# Expose the default Redis port
EXPOSE 6379
# Start redis server
ENTRYPOINT [ "redis-server", "/etc/redis/redis.conf" ]