diff --git a/bitnami/redis/4.0/ol-7/Dockerfile b/bitnami/redis/4.0/ol-7/Dockerfile new file mode 100644 index 000000000000..884b8ed59962 --- /dev/null +++ b/bitnami/redis/4.0/ol-7/Dockerfile @@ -0,0 +1,26 @@ +FROM bitnami/oraclelinux-extras:7-r3 +LABEL maintainer "Bitnami " + +ENV BITNAMI_PKG_CHMOD="-R g+rwX" \ + HOME="/" + +# Install required system packages and dependencies +RUN bitnami-pkg unpack redis-4.0.9-1 --checksum 856ee72c7ff72958a83b48c6c862bc502f5ae9ff4a301e9eab33b991f2b452dd + +COPY rootfs / +ENV ALLOW_EMPTY_PASSWORD="no" \ + BITNAMI_APP_NAME="redis" \ + BITNAMI_IMAGE_VERSION="4.0.9-ol-7-r13" \ + PATH="/opt/bitnami/redis/bin:$PATH" \ + REDIS_DISABLE_COMMANDS="" \ + REDIS_MASTER_HOST="" \ + REDIS_MASTER_PASSWORD="" \ + REDIS_MASTER_PORT_NUMBER="6379" \ + REDIS_PASSWORD="" \ + REDIS_REPLICATION_MODE="" + +EXPOSE 6379 + +USER 1001 +ENTRYPOINT ["/app-entrypoint.sh"] +CMD ["/run.sh"] diff --git a/bitnami/redis/4.0/ol-7/docker-compose.yml b/bitnami/redis/4.0/ol-7/docker-compose.yml new file mode 100644 index 000000000000..196f10c4194b --- /dev/null +++ b/bitnami/redis/4.0/ol-7/docker-compose.yml @@ -0,0 +1,17 @@ +version: '2' + +services: + redis: + image: 'bitnami/redis:4.0-ol-7' + environment: + # ALLOW_EMPTY_PASSWORD is recommended only for development. + - ALLOW_EMPTY_PASSWORD=yes + - REDIS_DISABLE_COMMANDS=FLUSHDB,FLUSHALL + ports: + - '6379:6379' + volumes: + - 'redis_data:/bitnami' + +volumes: + redis_data: + driver: local diff --git a/bitnami/redis/4.0/ol-7/rootfs/app-entrypoint.sh b/bitnami/redis/4.0/ol-7/rootfs/app-entrypoint.sh new file mode 100755 index 000000000000..243dbed79b02 --- /dev/null +++ b/bitnami/redis/4.0/ol-7/rootfs/app-entrypoint.sh @@ -0,0 +1,14 @@ +#!/bin/bash -e + +. /opt/bitnami/base/functions +. /opt/bitnami/base/helpers + +print_welcome_page + +if [[ "$1" == "nami" && "$2" == "start" ]] || [[ "$1" == "/run.sh" ]]; then + . /init.sh + nami_initialize redis + info "Starting redis... " +fi + +exec tini -- "$@" diff --git a/bitnami/redis/4.0/ol-7/rootfs/init.sh b/bitnami/redis/4.0/ol-7/rootfs/init.sh new file mode 100644 index 000000000000..d10b62a51a2c --- /dev/null +++ b/bitnami/redis/4.0/ol-7/rootfs/init.sh @@ -0,0 +1,30 @@ +## +## @brief Helper function to show an error when a password is empty and exit +## param $1 Input name +## +empty_password_error() { + error "The $1 environment variable is empty or not set. Set the environment variable ALLOW_EMPTY_PASSWORD=yes to allow the container to be started with blank passwords. This is recommended only for development." + exit 1 +} + +## +## @brief Helper function to show a warning when the ALLOW_EMPTY_PASSWORD flag is enabled +## +empty_password_enabled_warn() { + warn "You set the environment variable ALLOW_EMPTY_PASSWORD=${ALLOW_EMPTY_PASSWORD}. For safety reasons, do not use this flag in a production environment." +} + + +# Validate passwords +if [[ "$ALLOW_EMPTY_PASSWORD" =~ ^(yes|Yes|YES)$ ]]; then + empty_password_enabled_warn +else + # Root user + if [[ -z "$REDIS_PASSWORD" ]]; then + empty_password_error REDIS_PASSWORD + fi + # Replication user + if [[ "$REDIS_REPLICATION_MODE" == "slave" && -z "$REDIS_MASTER_PASSWORD" ]]; then + empty_password_error REDIS_MASTER_PASSWORD + fi +fi diff --git a/bitnami/redis/4.0/ol-7/rootfs/redis-inputs.json b/bitnami/redis/4.0/ol-7/rootfs/redis-inputs.json new file mode 100644 index 000000000000..4f14fcea40ca --- /dev/null +++ b/bitnami/redis/4.0/ol-7/rootfs/redis-inputs.json @@ -0,0 +1,9 @@ +{ + "allowEmptyPassword": "{{$global.env.ALLOW_EMPTY_PASSWORD}}", + "disableCommands": "{{$global.env.REDIS_DISABLE_COMMANDS}}", + "masterHost": "{{$global.env.REDIS_MASTER_HOST}}", + "masterPassword": "{{$global.env.REDIS_MASTER_PASSWORD}}", + "masterPort": "{{$global.env.REDIS_MASTER_PORT_NUMBER}}", + "password": "{{$global.env.REDIS_PASSWORD}}", + "replicationMode": "{{$global.env.REDIS_REPLICATION_MODE}}" +} \ No newline at end of file diff --git a/bitnami/redis/4.0/ol-7/rootfs/run.sh b/bitnami/redis/4.0/ol-7/rootfs/run.sh new file mode 100755 index 000000000000..c0e73690818a --- /dev/null +++ b/bitnami/redis/4.0/ol-7/rootfs/run.sh @@ -0,0 +1,23 @@ +#!/bin/bash +. /opt/bitnami/base/functions +. /opt/bitnami/base/helpers + +USER=redis +DAEMON=redis-server +EXEC=$(which $DAEMON) +ARGS="/opt/bitnami/redis/conf/redis.conf --daemonize no" + +# configure extra command line flags +if [[ -n "$REDIS_EXTRA_FLAGS" ]]; then + ARGS+=" $REDIS_EXTRA_FLAGS" +fi + +# log output to stdout +sed -i 's/^logfile /# logfile /g' /opt/bitnami/redis/conf/redis.conf + +# If container is started as `root` user +if [ $EUID -eq 0 ]; then + exec gosu ${USER} ${EXEC} ${ARGS} +else + exec ${EXEC} ${ARGS} +fi diff --git a/bitnami/redis/README.md b/bitnami/redis/README.md index ada40d094a46..ae7ed0a2fcf3 100644 --- a/bitnami/redis/README.md +++ b/bitnami/redis/README.md @@ -27,6 +27,13 @@ $ docker-compose up -d * Bitnami images are built on CircleCI and automatically pushed to the Docker Hub. * All our images are based on [minideb](https://github.com/bitnami/minideb) a minimalist Debian based container image which gives you a small base container image and the familiarity of a leading linux distribution. +# Supported tags and respective `Dockerfile` links + +* [`4.0`, `4.0.9-r12`, `latest` (4.0/Dockerfile)](https://github.com/bitnami/bitnami-docker-redis/blob/4.0.9-r12/4.0/Dockerfile) +* [`4.0-ol-7`, `4.0.9-ol-7-r13` (4.0/ol-7/Dockerfile)](https://github.com/bitnami/bitnami-docker-redis/blob/4.0.9-ol-7-r13/4.0/ol-7/Dockerfile) + +Subscribe to project updates by watching the [bitnami/redis GitHub repo](https://github.com/bitnami/bitnami-docker-redis). + # Get this image The recommended way to get the Bitnami Redis Docker Image is to pull the prebuilt image from the [Docker Hub Registry](https://hub.docker.com/r/bitnami/redis). diff --git a/bitnami/redis/circle.yml b/bitnami/redis/circle.yml index 053457338757..dc815714d226 100644 --- a/bitnami/redis/circle.yml +++ b/bitnami/redis/circle.yml @@ -7,6 +7,7 @@ jobs: environment: RELEASE_SERIES_LIST: "4.0" LATEST_STABLE: "4.0" + DISTRIBUTIONS_LIST: "debian-8,ol-7" IMAGE_NAME: redis CHART_NAME: redis CHART_REPO: https://github.com/kubernetes/charts