mirror of
https://github.com/bitnami/containers.git
synced 2026-03-01 15:07:17 +08:00
Merge branch 'entrypoint-disambiguation
This commit is contained in:
@@ -3,19 +3,26 @@ MAINTAINER Bitnami <containers@bitnami.com>
|
||||
|
||||
ENV BITNAMI_IMAGE_VERSION=3.2.8-r0 \
|
||||
BITNAMI_APP_NAME=redis \
|
||||
BITNAMI_APP_USER=redis
|
||||
PATH=/opt/bitnami/redis/bin:$PATH
|
||||
|
||||
# System packages required
|
||||
RUN install_packages libc6
|
||||
|
||||
# Install redis
|
||||
RUN bitnami-pkg unpack redis-3.2.8-0 --checksum 2dcd69c0bbcb6e2ab82975d39ee32c2795c612e85012d599d36553c4f5ab8f3d
|
||||
ENV PATH=/opt/bitnami/$BITNAMI_APP_NAME/sbin:/opt/bitnami/$BITNAMI_APP_NAME/bin:$PATH
|
||||
|
||||
COPY rootfs /
|
||||
ENTRYPOINT ["/app-entrypoint.sh"]
|
||||
CMD ["nami", "start", "--foreground", "redis"]
|
||||
|
||||
VOLUME ["/bitnami/$BITNAMI_APP_NAME"]
|
||||
ENV REDIS_PASSWORD= \
|
||||
REDIS_REPLICATION_MODE= \
|
||||
REDIS_MASTER_HOST= \
|
||||
REDIS_MASTER_PORT=6379 \
|
||||
REDIS_MASTER_PASSWORD=
|
||||
|
||||
VOLUME ["/bitnami/redis"]
|
||||
|
||||
EXPOSE 6379
|
||||
|
||||
ENTRYPOINT ["/app-entrypoint.sh"]
|
||||
|
||||
CMD ["nami", "start", "--foreground", "redis"]
|
||||
|
||||
@@ -1,28 +1,13 @@
|
||||
#!/bin/bash -e
|
||||
. /opt/bitnami/base/functions
|
||||
. /opt/bitnami/base/helpers
|
||||
|
||||
function initialize {
|
||||
# Package can be "installed" or "unpacked"
|
||||
status=`nami inspect $1`
|
||||
if [[ "$status" == *'"lifecycle": "unpacked"'* ]]; then
|
||||
# Clean up inputs
|
||||
inputs=""
|
||||
if [[ -f /$1-inputs.json ]]; then
|
||||
inputs=--inputs-file=/$1-inputs.json
|
||||
fi
|
||||
nami initialize $1 $inputs
|
||||
fi
|
||||
}
|
||||
print_welcome_page
|
||||
check_for_updates &
|
||||
|
||||
# Set default values
|
||||
export REDIS_PASSWORD=${REDIS_PASSWORD:-}
|
||||
export REDIS_REPLICATION_MODE=${REDIS_REPLICATION_MODE:-}
|
||||
export REDIS_MASTER_HOST=${REDIS_MASTER_HOST:-}
|
||||
export REDIS_MASTER_PORT=${REDIS_MASTER_PORT:-6379}
|
||||
export REDIS_MASTER_PASSWORD=${REDIS_MASTER_PASSWORD:-}
|
||||
|
||||
if [[ "$1" == "nami" && "$2" == "start" ]] || [[ "$1" == "/init.sh" ]]; then
|
||||
initialize redis
|
||||
echo "Starting application ..."
|
||||
if [[ "$1" == "nami" && "$2" == "start" ]] || [[ "$1" == "/init.sh" ]]; then
|
||||
nami_initialize redis
|
||||
info "Starting redis..."
|
||||
fi
|
||||
|
||||
exec /entrypoint.sh "$@"
|
||||
exec tini -- "$@"
|
||||
|
||||
Reference in New Issue
Block a user