forked from redis/docker-library-redis
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request redis#98 from infosiftr/4.0
Add 4.0 (remove 3.0)
- Loading branch information
Showing
12 changed files
with
104 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
FROM alpine:3.6 | ||
|
||
# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added | ||
RUN addgroup -S redis && adduser -S -G redis redis | ||
|
||
# grab su-exec for easy step-down from root | ||
RUN apk add --no-cache 'su-exec>=0.2' | ||
|
||
ENV REDIS_VERSION 4.0.0 | ||
ENV REDIS_DOWNLOAD_URL http://download.redis.io/releases/redis-4.0.0.tar.gz | ||
ENV REDIS_DOWNLOAD_SHA d539ae309295721d5c3ed7298939645b6f86ab5d25fdf2a0352ab575c159df2d | ||
|
||
# for redis-sentinel see: http://redis.io/topics/sentinel | ||
RUN set -ex; \ | ||
\ | ||
apk add --no-cache --virtual .build-deps \ | ||
coreutils \ | ||
gcc \ | ||
linux-headers \ | ||
make \ | ||
musl-dev \ | ||
; \ | ||
\ | ||
wget -O redis.tar.gz "$REDIS_DOWNLOAD_URL"; \ | ||
echo "$REDIS_DOWNLOAD_SHA *redis.tar.gz" | sha256sum -c -; \ | ||
mkdir -p /usr/src/redis; \ | ||
tar -xzf redis.tar.gz -C /usr/src/redis --strip-components=1; \ | ||
rm redis.tar.gz; \ | ||
\ | ||
# disable Redis protected mode [1] as it is unnecessary in context of Docker | ||
# (ports are not automatically exposed when running inside Docker, but rather explicitly by specifying -p / -P) | ||
# [1]: https://github.com/antirez/redis/commit/edd4d555df57dc84265fdfb4ef59a4678832f6da | ||
grep -q '^#define CONFIG_DEFAULT_PROTECTED_MODE 1$' /usr/src/redis/src/server.h; \ | ||
sed -ri 's!^(#define CONFIG_DEFAULT_PROTECTED_MODE) 1$!\1 0!' /usr/src/redis/src/server.h; \ | ||
grep -q '^#define CONFIG_DEFAULT_PROTECTED_MODE 0$' /usr/src/redis/src/server.h; \ | ||
# for future reference, we modify this directly in the source instead of just supplying a default configuration flag because apparently "if you specify any argument to redis-server, [it assumes] you are going to specify everything" | ||
# see also https://github.com/docker-library/redis/issues/4#issuecomment-50780840 | ||
# (more exactly, this makes sure the default behavior of "save on SIGTERM" stays functional by default) | ||
\ | ||
make -C /usr/src/redis -j "$(nproc)"; \ | ||
make -C /usr/src/redis install; \ | ||
\ | ||
rm -r /usr/src/redis; \ | ||
\ | ||
apk del .build-deps | ||
|
||
RUN mkdir /data && chown redis:redis /data | ||
VOLUME /data | ||
WORKDIR /data | ||
|
||
COPY docker-entrypoint.sh /usr/local/bin/ | ||
ENTRYPOINT ["docker-entrypoint.sh"] | ||
|
||
EXPOSE 6379 | ||
CMD ["redis-server"] |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters