From f57e0bd0a84c1b6ae6b3174ccc9ac6a85c3eecd8 Mon Sep 17 00:00:00 2001 From: Bitnami Bot Date: Mon, 6 Mar 2023 01:17:20 +0100 Subject: [PATCH] [bitnami/memcached] Release 1.6.18-debian-11-r21 (#26429) Signed-off-by: Bitnami Containers --- bitnami/memcached/1/debian-11/Dockerfile | 8 +-- .../opt/bitnami/.bitnami_components.json | 4 +- .../opt/bitnami/scripts/libservice.sh | 54 +++++++++++++++---- 3 files changed, 50 insertions(+), 16 deletions(-) diff --git a/bitnami/memcached/1/debian-11/Dockerfile b/bitnami/memcached/1/debian-11/Dockerfile index 9b5bc01c1242..2c0b352cfd8f 100644 --- a/bitnami/memcached/1/debian-11/Dockerfile +++ b/bitnami/memcached/1/debian-11/Dockerfile @@ -3,10 +3,10 @@ FROM docker.io/bitnami/minideb:bullseye ARG TARGETARCH LABEL org.opencontainers.image.base.name="docker.io/bitnami/minideb:bullseye" \ - org.opencontainers.image.created="2023-03-02T19:45:03Z" \ + org.opencontainers.image.created="2023-03-05T23:51:29Z" \ org.opencontainers.image.description="Application packaged by VMware, Inc" \ org.opencontainers.image.licenses="Apache-2.0" \ - org.opencontainers.image.ref.name="1.6.18-debian-11-r19" \ + org.opencontainers.image.ref.name="1.6.18-debian-11-r21" \ org.opencontainers.image.title="memcached" \ org.opencontainers.image.vendor="VMware, Inc." \ org.opencontainers.image.version="1.6.18" @@ -19,10 +19,10 @@ ENV HOME="/" \ COPY prebuildfs / SHELL ["/bin/bash", "-o", "pipefail", "-c"] # Install required system packages and dependencies -RUN install_packages ca-certificates curl libevent-2.1-7 libsasl2-2 libsasl2-modules procps sasl2-bin +RUN install_packages ca-certificates curl libevent-2.1-7 libsasl2-2 libsasl2-modules netcat procps sasl2-bin RUN mkdir -p /tmp/bitnami/pkg/cache/ && cd /tmp/bitnami/pkg/cache/ && \ COMPONENTS=( \ - "memcached-1.6.18-3-linux-${OS_ARCH}-debian-11" \ + "memcached-1.6.18-4-linux-${OS_ARCH}-debian-11" \ "gosu-1.16.0-2-linux-${OS_ARCH}-debian-11" \ ) && \ for COMPONENT in "${COMPONENTS[@]}"; do \ diff --git a/bitnami/memcached/1/debian-11/prebuildfs/opt/bitnami/.bitnami_components.json b/bitnami/memcached/1/debian-11/prebuildfs/opt/bitnami/.bitnami_components.json index a48720017126..c0b6f1547668 100644 --- a/bitnami/memcached/1/debian-11/prebuildfs/opt/bitnami/.bitnami_components.json +++ b/bitnami/memcached/1/debian-11/prebuildfs/opt/bitnami/.bitnami_components.json @@ -8,9 +8,9 @@ }, "memcached": { "arch": "amd64", - "digest": "054239ab91a6ea7d2ac024215b96b049d3191169c1adb0321aed9079c8704df6", + "digest": "24574870e83eb7553d456174950acab186c9b194cb67c1c25778e0fcb8b5f090", "distro": "debian-11", "type": "NAMI", - "version": "1.6.18-3" + "version": "1.6.18-4" } } \ No newline at end of file diff --git a/bitnami/memcached/1/debian-11/prebuildfs/opt/bitnami/scripts/libservice.sh b/bitnami/memcached/1/debian-11/prebuildfs/opt/bitnami/scripts/libservice.sh index af64e198ad2d..2d53aca9af84 100644 --- a/bitnami/memcached/1/debian-11/prebuildfs/opt/bitnami/scripts/libservice.sh +++ b/bitnami/memcached/1/debian-11/prebuildfs/opt/bitnami/scripts/libservice.sh @@ -277,16 +277,21 @@ remove_logrotate_conf() { # Arguments: # $1 - Service name # Flags: +# --custom-service-content - Custom content to add to the [service] block +# --environment - Environment variable to define (multiple --environment options may be passed) +# --environment-file - Text file with environment variables # --exec-start - Start command (required) # --exec-stop - Stop command (optional) # --exec-reload - Reload command (optional) +# --group - System group to start the service with # --name - Service full name (e.g. Apache HTTP Server, defaults to $1) # --restart - When to restart the Systemd service after being stopped (defaults to always) -# --pid-file - Service PID file (required when --restart is set to always) +# --pid-file - Service PID file +# --standard-output - File where to print stdout output +# --standard-error - File where to print stderr output +# --success-exit-status - Exit code that indicates a successful shutdown # --type - Systemd unit type (defaults to forking) # --user - System user to start the service with -# --group - System group to start the service with -# --environment - Environment variable to define (multiple --environment options may be passed) # Returns: # None ######################### @@ -300,6 +305,7 @@ generate_systemd_conf() { local user="" local group="" local environment="" + local environment_file="" local exec_start="" local exec_stop="" local exec_reload="" @@ -307,6 +313,9 @@ generate_systemd_conf() { local pid_file="" local standard_output="journal" local standard_error="" + local limits_content="" + local success_exit_status="" + local custom_service_content="" # Parse CLI flags shift while [[ "$#" -gt 0 ]]; do @@ -315,6 +324,7 @@ generate_systemd_conf() { | --type \ | --user \ | --group \ + | --environment-file \ | --exec-start \ | --exec-stop \ | --exec-reload \ @@ -322,10 +332,18 @@ generate_systemd_conf() { | --pid-file \ | --standard-output \ | --standard-error \ + | --success-exit-status \ + | --custom-service-content \ ) var_name="$(echo "$1" | sed -e "s/^--//" -e "s/-/_/g")" shift - declare "$var_name"="${1:?"$var_name" is missing}" + declare "$var_name"="${1:?"${var_name} value is missing"}" + ;; + --limit-*) + [[ -n "$limits_content" ]] && limits_content+=$'\n' + var_name="${1//--limit-}" + shift + limits_content+="Limit${var_name^^}=${1:?"--limit-${var_name} value is missing"}" ;; --environment) shift @@ -346,10 +364,6 @@ generate_systemd_conf() { error "The --exec-start option is required" error="yes" fi - if [[ "$restart" = "always" && -z "$pid_file" ]]; then - error "The --restart option cannot be set to 'always' if --pid-file is not set" - error="yes" - fi if [[ "$error" != "no" ]]; then return 1 fi @@ -382,10 +396,16 @@ EOF if [[ -n "$pid_file" ]]; then cat >> "$service_file" <<< "PIDFile=${pid_file}" fi + if [[ -n "$restart" ]]; then + cat >> "$service_file" <<< "Restart=${restart}" + fi # Environment flags (may be specified multiple times in a unit) if [[ -n "$environment" ]]; then cat >> "$service_file" <<< "$environment" fi + if [[ -n "$environment_file" ]]; then + cat >> "$service_file" <<< "EnvironmentFile=${environment_file}" + fi # Logging if [[ -n "$standard_output" ]]; then cat >> "$service_file" <<< "StandardOutput=${standard_output}" @@ -393,14 +413,28 @@ EOF if [[ -n "$standard_error" ]]; then cat >> "$service_file" <<< "StandardError=${standard_error}" fi + if [[ -n "$custom_service_content" ]]; then + cat >> "$service_file" <<< "$custom_service_content" + fi + if [[ -n "$success_exit_status" ]]; then + cat >> "$service_file" <> "$service_file" <> "$service_file" <> "$service_file" <