Skip to content

Add redis:3.0-alpine #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ services: docker
env:
- VERSION=3.0 VARIANT=
- VERSION=3.0 VARIANT=32bit
- VERSION=3.0 VARIANT=alpine
- VERSION=2.8 VARIANT=
- VERSION=2.8 VARIANT=32bit

Expand Down
41 changes: 41 additions & 0 deletions 3.0/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
FROM alpine:3.3

# 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 -D -S -G redis redis

ENV REDIS_VERSION 3.0.6
ENV REDIS_DOWNLOAD_URL http://download.redis.io/releases/redis-3.0.6.tar.gz
ENV REDIS_DOWNLOAD_SHA1 4b1c7b1201984bca8f7f9c6c58862f6928cf0a25

# for redis-sentinel see: http://redis.io/topics/sentinel
RUN set -x \
&& apk add --no-cache --virtual .build-deps \
gcc libc-dev linux-headers make curl su-exec \
&& mkdir -p /usr/src \
&& curl -sSL "$REDIS_DOWNLOAD_URL" -o redis.tar.gz \
&& echo "$REDIS_DOWNLOAD_SHA1 *redis.tar.gz" | sha1sum -c - \
&& tar -xzf redis.tar.gz -C /usr/src \
&& mv /usr/src/redis-$REDIS_VERSION /usr/src/redis \
&& rm redis.tar.gz \
&& make -C /usr/src/redis \
&& make -C /usr/src/redis install \
&& runDeps="$( \
scanelf --needed --nobanner --recursive /usr/local \
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
| sort -u \
| xargs -r apk info --installed \
| sort -u \
)" \
&& apk add --no-cache --virtual .redis-rundeps su-exec $runDeps \
&& apk del .build-deps \
&& rm -r /usr/src/redis

RUN mkdir /data && chown redis:redis /data
VOLUME /data
WORKDIR /data

COPY docker-entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

EXPOSE 6379
CMD [ "redis-server" ]
9 changes: 9 additions & 0 deletions 3.0/alpine/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh
set -e

if [ "$1" = 'redis-server' ]; then
chown -R redis .
exec su-exec redis "$@"
fi

exec "$@"
4 changes: 2 additions & 2 deletions generate-stackbrew-library.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ for version in "${versions[@]}"; do
for va in "${versionAliases[@]}"; do
echo "$va: ${url}@${commit} $version"
done
for variant in 32bit; do

for variant in 32bit alpine; do
[ -f "$version/$variant/Dockerfile" ] || continue
commit="$(cd "$version/$variant" && git log -1 --format='format:%H' -- Dockerfile $(awk 'toupper($1) == "COPY" { for (i = 2; i < NF; i++) { print $i } }' Dockerfile))"
echo
Expand Down