Skip to content

Commit

Permalink
Merge pull request redis#98 from infosiftr/4.0
Browse files Browse the repository at this point in the history
Add 4.0 (remove 3.0)
  • Loading branch information
yosifkit committed Jul 14, 2017
2 parents f131897 + f610cf8 commit 046d3d4
Show file tree
Hide file tree
Showing 12 changed files with 104 additions and 139 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ language: bash
services: docker

env:
- VERSION=4.0 VARIANT=
- VERSION=4.0 VARIANT=32bit
- VERSION=4.0 VARIANT=alpine
- VERSION=3.2 VARIANT=
- VERSION=3.2 VARIANT=32bit
- VERSION=3.2 VARIANT=alpine
- VERSION=3.0 VARIANT=
- VERSION=3.0 VARIANT=32bit
- VERSION=3.0 VARIANT=alpine

install:
- git clone https://github.com/docker-library/official-images.git ~/official-images
Expand Down
46 changes: 0 additions & 46 deletions 3.0/alpine/Dockerfile

This file was deleted.

32 changes: 0 additions & 32 deletions 3.0/windows/nanoserver/Dockerfile

This file was deleted.

32 changes: 0 additions & 32 deletions 3.0/windows/windowsservercore/Dockerfile

This file was deleted.

19 changes: 14 additions & 5 deletions 3.0/32bit/Dockerfile → 4.0/32bit/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ RUN set -ex; \
\
apt-get purge -y --auto-remove $fetchDeps

ENV REDIS_VERSION 3.0.7
ENV REDIS_DOWNLOAD_URL http://download.redis.io/releases/redis-3.0.7.tar.gz
ENV REDIS_DOWNLOAD_SHA e56b4b7e033ae8dbf311f9191cf6fdf3ae974d1c
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

RUN apt-get update && apt-get install -y --no-install-recommends \
libc6-i386 \
Expand All @@ -49,11 +49,21 @@ RUN set -ex; \
rm -rf /var/lib/apt/lists/*; \
\
wget -O redis.tar.gz "$REDIS_DOWNLOAD_URL"; \
echo "$REDIS_DOWNLOAD_SHA *redis.tar.gz" | sha1sum -c -; \
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)" 32bit; \
make -C /usr/src/redis install; \
\
Expand All @@ -66,7 +76,6 @@ VOLUME /data
WORKDIR /data

COPY docker-entrypoint.sh /usr/local/bin/
RUN ln -s usr/local/bin/docker-entrypoint.sh /entrypoint.sh # backwards compat
ENTRYPOINT ["docker-entrypoint.sh"]

EXPOSE 6379
Expand Down
File renamed without changes.
19 changes: 14 additions & 5 deletions 3.0/Dockerfile → 4.0/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ RUN set -ex; \
\
apt-get purge -y --auto-remove $fetchDeps

ENV REDIS_VERSION 3.0.7
ENV REDIS_DOWNLOAD_URL http://download.redis.io/releases/redis-3.0.7.tar.gz
ENV REDIS_DOWNLOAD_SHA e56b4b7e033ae8dbf311f9191cf6fdf3ae974d1c
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; \
Expand All @@ -44,11 +44,21 @@ RUN set -ex; \
rm -rf /var/lib/apt/lists/*; \
\
wget -O redis.tar.gz "$REDIS_DOWNLOAD_URL"; \
echo "$REDIS_DOWNLOAD_SHA *redis.tar.gz" | sha1sum -c -; \
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; \
\
Expand All @@ -61,7 +71,6 @@ VOLUME /data
WORKDIR /data

COPY docker-entrypoint.sh /usr/local/bin/
RUN ln -s usr/local/bin/docker-entrypoint.sh /entrypoint.sh # backwards compat
ENTRYPOINT ["docker-entrypoint.sh"]

EXPOSE 6379
Expand Down
55 changes: 55 additions & 0 deletions 4.0/alpine/Dockerfile
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.
4 changes: 2 additions & 2 deletions generate-stackbrew-library.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
set -eu

declare -A aliases=(
[2.8]='2'
[3.2]='3 latest'
[4.0]='4 latest'
[3.2]='3'
)

self="$(basename "$BASH_SOURCE")"
Expand Down
30 changes: 16 additions & 14 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,22 @@ for version in "${versions[@]}"; do
done
travisEnv='\n - VERSION='"$version VARIANT=$travisEnv"

windowsVersion="$(
git ls-remote --tags 'https://github.com/MSOpenTech/redis.git' \
| cut -d/ -f3 \
| grep -E "^win-${version}[.]" \
| cut -d- -f2- \
| sort -rV \
| head -n1
)"
(
set -x
sed -ri \
-e 's!^(ENV REDIS_VERSION) .*!\1 '"$windowsVersion"'!' \
"$version"/windows/*/Dockerfile
)
if [ -d "$version/windows" ]; then
windowsVersion="$(
git ls-remote --tags 'https://github.com/MSOpenTech/redis.git' \
| cut -d/ -f3 \
| grep -E "^win-${version}[.]" \
| cut -d- -f2- \
| sort -rV \
| head -n1
)"
(
set -x
sed -ri \
-e 's!^(ENV REDIS_VERSION) .*!\1 '"$windowsVersion"'!' \
"$version"/windows/*/Dockerfile
)
fi
done

travis="$(awk -v 'RS=\n\n' '$1 == "env:" { $0 = "env:'"$travisEnv"'" } { printf "%s%s", $0, RS }' .travis.yml)"
Expand Down

0 comments on commit 046d3d4

Please sign in to comment.