Aerospike 6.2.0.1
https://download.aerospike.com/download/server/notes.html
Diff for 11324375b0bd2570d243b62a84647d4cf4a3f291:
diff --git a/_bashbrew-cat b/_bashbrew-cat
index 31cc9aa..3d0932c 100644
--- a/_bashbrew-cat
+++ b/_bashbrew-cat
@@ -1,9 +1,13 @@
-Maintainers: Lucien Volmar <[email protected]> (@volmarl), Michael Coberly <[email protected]> (@mcoberly2), Phuc Vinh <[email protected]> (@pvinh-spike)
+Maintainers: Lucien Volmar <[email protected]> (@volmarl), Michael Coberly <[email protected]> (@mcoberly2), Phuc Vinh <[email protected]> (@pvinh-spike), Kevin Porter <[email protected]> (@kportertx)
-Tags: ce-6.1.0.3
+Tags: ce-6.2.0.1
+Architectures: amd64, arm64v8
GitRepo: https://github.com/aerospike/aerospike-server.docker.git
-GitCommit: 4557452ca88bcad1929e91bd303b522a1c242b12
+GitCommit: 91bf8f2010dd95d7c14935f0d63d3733657137bc
+Directory: community/debian11
-Tags: ee-6.1.0.3
-GitRepo: https://github.com/aerospike/aerospike-server-enterprise.docker.git
-GitCommit: 01871453aad7390a02a51dee11efe8e6a55f95cf
+Tags: ee-6.2.0.1
+Architectures: amd64, arm64v8
+GitRepo: https://github.com/aerospike/aerospike-server.docker.git
+GitCommit: 91bf8f2010dd95d7c14935f0d63d3733657137bc
+Directory: enterprise/debian11
diff --git a/_bashbrew-list b/_bashbrew-list
index a151121..6e7aa6a 100644
--- a/_bashbrew-list
+++ b/_bashbrew-list
@@ -1,2 +1,2 @@
-aerospike:ce-6.1.0.3
-aerospike:ee-6.1.0.3
+aerospike:ce-6.2.0.1
+aerospike:ee-6.2.0.1
diff --git a/aerospike_ce-6.1.0.3/.dockerignore b/aerospike_ce-6.1.0.3/.dockerignore
deleted file mode 100644
index e5b80c1..0000000
diff --git a/aerospike_ce-6.1.0.3/Dockerfile b/aerospike_ce-6.2.0.1/Dockerfile
similarity index 27%
rename from aerospike_ce-6.1.0.3/Dockerfile
rename to aerospike_ce-6.2.0.1/Dockerfile
index 45512a0..24e4a20 100644
--- a/aerospike_ce-6.1.0.3/Dockerfile
+++ b/aerospike_ce-6.2.0.1/Dockerfile
@@ -4,61 +5,41 @@
# http://github.com/aerospike/aerospike-server.docker
#
-
FROM debian:bullseye-slim
-ENV AEROSPIKE_VERSION 6.1.0.3
-ENV AEROSPIKE_SHA256 e4f9c152209547517951b78e42ca0251bd237fe1eba65b7bef81fea94ab653c9
-ENV AS_TINI_SHA256 d1f6826dd70cdd88dde3d5a20d8ed248883a3bc2caba3071c8a3a9b0e0de5940
+LABEL \
+ maintainer="Aerospike, Inc. <[email protected]>" \
+ name="aerospike-community" \
+ vendor="Aerospike" \
+ version="6.2.0.1" \
+ release="1" \
+ summary="Aerospike Server Community Edition" \
+ description="Aerospike is a real-time database with predictable performance at petabyte scale with microsecond latency over billions of transactions." \
+ io.k8s.display-name="Aerospike Server Community Edition 6.2.0.1" \
+ io.k8s.description="Aerospike is a real-time database with predictable performance at petabyte scale with microsecond latency over billions of transactions."
+
+ARG DEBUG="false"
+
+# AEROSPIKE_EDITION - required - must be "community", "enterprise", or
+# "federal".
+# By selecting "community" you agree to the "COMMUNITY_LICENSE".
+# By selecting "enterprise" you agree to the "ENTERPRISE_LICENSE".
+# By selecting "federal" you agree to the "FEDERAL_LICENSE"
+ARG AEROSPIKE_EDITION="community"
+
+ARG AEROSPIKE_X86_64_LINK="https://artifacts.aerospike.com/aerospike-server-community/6.2.0.1/aerospike-server-community_6.2.0.1_tools-8.0.3_debian11_x86_64.tgz"
+ARG AEROSPIKE_SHA_X86_64="aacecb7f1f9da3f5a19e8f33ec0897a1c64d0c03144ff0c7ac29317ee012f3e5"
+ARG AEROSPIKE_AARCH64_LINK="https://artifacts.aerospike.com/aerospike-server-community/6.2.0.1/aerospike-server-community_6.2.0.1_tools-8.0.3_debian11_aarch64.tgz"
+ARG AEROSPIKE_SHA_AARCH64="0a79a427dadee55691417ced2c65ee7126d93294d56ea90a88cf3b28eb20ee50"
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Install Aerospike Server and Tools
-RUN \
- export DEBIAN_FRONTEND=noninteractive \
- && apt-get update -y \
- && apt-get install -y --no-install-recommends \
- apt-utils \
- 2>&1 | grep -v "delaying package configuration" \
- && apt-get install -y --no-install-recommends \
- binutils \
- ca-certificates \
- gettext-base \
- wget \
- xz-utils \
- && wget https://github.com/aerospike/tini/releases/download/1.0.1/as-tini-static --progress=bar:force:noscroll -O /usr/bin/as-tini-static 2>&1 \
- && echo "$AS_TINI_SHA256 /usr/bin/as-tini-static" | sha256sum -c - \
- && chmod +x /usr/bin/as-tini-static \
- && wget "https://artifacts.aerospike.com/aerospike-server-community/${AEROSPIKE_VERSION}/aerospike-server-community-${AEROSPIKE_VERSION}-debian11.tgz" --progress=bar:force:noscroll -O aerospike-server.tgz 2>&1 \
- && echo "$AEROSPIKE_SHA256 aerospike-server.tgz" | sha256sum -c - \
- && mkdir -p aerospike/pkg \
- && tar xzf aerospike-server.tgz --strip-components=1 -C aerospike \
- && dpkg -i aerospike/aerospike-server-*.deb \
- && ar --output aerospike/pkg -x aerospike/aerospike-tools-*.deb \
- && tar xf aerospike/pkg/data.tar.xz -C aerospike/pkg/ \
- && rm -rf aerospike-server.tgz /var/lib/apt/lists/* \
- && dpkg -r apt-utils binutils ca-certificates wget xz-utils \
- && dpkg --purge apt-utils binutils ca-certificates wget xz-utils 2>&1 \
- && apt-get purge -y \
- && apt-get autoremove -y \
- && find aerospike/pkg/opt/aerospike/bin/ -user aerospike -group aerospike -exec chown root:root {} + \
- && mv aerospike/pkg/etc/aerospike/astools.conf /etc/aerospike \
- # Since tools release 7.0.5, asadm has been moved from /opt/aerospike/bin/asadm to /opt/aerospike/bin/asadm/asadm (inside an asadm directory)
- && if [ -d 'aerospike/pkg/opt/aerospike/bin/asadm' ]; then \
- mv aerospike/pkg/opt/aerospike/bin/asadm /usr/lib/; \
- ln -s /usr/lib/asadm/asadm /usr/bin/asadm; \
- # Since tools release 7.1.1, asinfo has been moved from /opt/aerospike/bin/asinfo to /opt/aerospike/bin/asadm/asinfo (inside an asadm directory)
- if [ -f /usr/lib/asadm/asinfo ]; then \
- ln -s /usr/lib/asadm/asinfo /usr/bin/asinfo; \
- fi \
- fi \
- && rm -rf /opt/aerospike/bin \
- && rm -rf aerospike
-
+COPY scripts/bootstrap.sh /bootstrap.sh
+RUN ./bootstrap.sh && rm bootstrap.sh
# Add the Aerospike configuration specific to this dockerfile
COPY aerospike.template.conf /etc/aerospike/aerospike.template.conf
-COPY entrypoint.sh /entrypoint.sh
# Mount the Aerospike data directory
# VOLUME ["/opt/aerospike/data"]
@@ -74,6 +54,7 @@ COPY entrypoint.sh /entrypoint.sh
#
EXPOSE 3000 3001 3002
+COPY scripts/entrypoint.sh /entrypoint.sh
# Tini init set to restart ASD on SIGUSR1 and terminate ASD on SIGTERM
ENTRYPOINT ["/usr/bin/as-tini-static", "-r", "SIGUSR1", "-t", "SIGTERM", "--", "/entrypoint.sh"]
diff --git a/aerospike_ee-6.1.0.3/aerospike.template.conf b/aerospike_ce-6.2.0.1/aerospike.template.conf
similarity index 79%
rename from aerospike_ee-6.1.0.3/aerospike.template.conf
rename to aerospike_ce-6.2.0.1/aerospike.template.conf
index b382a00..6737692 100644
--- a/aerospike_ee-6.1.0.3/aerospike.template.conf
+++ b/aerospike_ce-6.2.0.1/aerospike.template.conf
@@ -7,14 +7,14 @@
# This stanza must come first.
service {
- feature-key-file ${FEATURE_KEY_FILE}
+ $([ -n "${FEATURE_KEY_FILE}" ] && echo "feature-key-file ${FEATURE_KEY_FILE}")
}
logging {
- # Log file must be an absolute path.
- file ${LOGFILE} {
- context any info
- }
+ $([ -n "${LOGFILE}" ] && echo "# Log file must be an absolute path.")
+ $([ -n "${LOGFILE}" ] && echo "file ${LOGFILE} {")
+ $([ -n "${LOGFILE}" ] && echo " context any info")
+ $([ -n "${LOGFILE}" ] && echo "}")
# Send log messages to stdout
console {
@@ -27,7 +27,7 @@ network {
address ${SERVICE_ADDRESS}
port ${SERVICE_PORT}
- # Uncomment the following to set the `access-address` parameter to the
+ # Uncomment the following to set the 'access-address' parameter to the
# IP address of the Docker host. This will the allow the server to correctly
# publish the address which applications and other nodes in the cluster to
# use when addressing this node.
diff --git a/aerospike_ce-6.2.0.1/scripts/bootstrap.sh b/aerospike_ce-6.2.0.1/scripts/bootstrap.sh
new file mode 100755
index 0000000..6e5ce7f
--- /dev/null
+++ b/aerospike_ce-6.2.0.1/scripts/bootstrap.sh
@@ -0,0 +1,198 @@
+#!/usr/bin/env bash
+
+set -Eeuo pipefail
+
+# keep track of the last executed command
+# shellcheck disable=SC2154
+trap 'last_command=${current_command:=""}; current_command=$BASH_COMMAND' DEBUG
+
+# echo an error message before exiting
+# shellcheck disable=SC2154
+trap 'echo "\"${last_command}\" command filed with exit code $?."' EXIT
+
+ARCH="$(uname -m)"
+
+function _log_level() {
+ level=$1
+ msg=$2
+
+ echo -e "${level} ${BASH_SOURCE[2]}:${BASH_LINENO[1]} - ${msg}" >&2
+}
+
+function log_debug() {
+ local msg=$1
+
+ if [ "${DEBUG:=}" = "true" ]; then
+ _log_level "debug" "${msg}"
+ fi
+}
+
+function log_warn() {
+ local msg=$1
+
+ _log_level "warn" "${msg}"
+}
+
+function fetch() {
+ local tag=$1
+ local link=$2
+
+ log_debug "${tag} - ${link}"
+
+ curl -fsSL "${link}" "${@:3}"
+}
+
+function install_bootstrap_dependencies() {
+ export DEBIAN_FRONTEND=noninteractive
+
+ apt-get update -y
+ apt-get install -y --no-install-recommends \
+ apt-utils \
+ 2>&1 | grep -v "delaying package configuration"
+
+ apt-get upgrade -y
+
+ apt-get install -y --no-install-recommends \
+ binutils \
+ ca-certificates \
+ curl \
+ xz-utils
+}
+
+function remove_bootstrap_dependencies() {
+ rm -rf /var/lib/apt/lists/*
+
+ dpkg -r \
+ apt-utils \
+ binutils \
+ ca-certificates \
+ curl \
+ xz-utils
+
+ dpkg --purge \
+ apt-utils \
+ binutils \
+ ca-certificates \
+ curl \
+ xz-utils 2>&1
+
+ apt-get purge -y
+ apt-get autoremove -y
+
+ unset DEBIAN_FRONTEND
+}
+
+function install_procps() {
+ # procps is needed for test using pgrep.
+ apt-get install -y --no-install-recommends procps
+}
+
+function install_tini() {
+ local sha256
+ local suffix
+
+ if [ "${ARCH}" = "x86_64" ]; then
+ sha256=d1f6826dd70cdd88dde3d5a20d8ed248883a3bc2caba3071c8a3a9b0e0de5940
+ suffix=""
+ elif [ "${ARCH}" = "aarch64" ]; then
+ sha256=1c398e5283af2f33888b7d8ac5b01ac89f777ea27c85d25866a40d1e64d0341b
+ suffix="-arm64"
+ else
+ log_warn "Unsuported architecture - ${ARCH}"
+ exit 1
+ fi
+
+ fetch "tini" "https://github.com/aerospike/tini/releases/download/1.0.1/as-tini-static${suffix}" --output /usr/bin/as-tini-static
+
+ echo "${sha256} /usr/bin/as-tini-static" | sha256sum -c -
+ chmod +x /usr/bin/as-tini-static
+}
+
+function install_aerospike_server() {
+ if [ "${AEROSPIKE_EDITION}" = "enterprise" ]; then
+ apt-get install -y --no-install-recommends \
+ libcurl4 \
+ libldap-2.4.2
+ fi
+
+ dpkg -i aerospike/aerospike-server-*.deb
+ rm -rf /opt/aerospike/bin
+}
+
+function install_aerospike_tools_subset() {
+ cd aerospike/pkg # ar on debian10 doesn't support '--output'
+ ar -x ../aerospike-tools*.deb
+ cd -
+ tar xf aerospike/pkg/data.tar.xz -C aerospike/pkg/
+
+ find aerospike/pkg/opt/aerospike/bin/ -user aerospike -group aerospike -exec chown root:root {} +
+ mv aerospike/pkg/etc/aerospike/astools.conf /etc/aerospike
+
+ # Since tools release 7.0.5, asadm has been moved from /opt/aerospike/bin/asadm to /opt/aerospike/bin/asadm/asadm (inside an asadm directory)
+ if [ -d 'aerospike/pkg/opt/aerospike/bin/asadm' ]; then
+ mv aerospike/pkg/opt/aerospike/bin/asadm /usr/lib/
+ ln -s /usr/lib/asadm/asadm /usr/bin/asadm
+
+ # Since tools release 7.1.1, asinfo has been moved from /opt/aerospike/bin/asinfo to /opt/aerospike/bin/asadm/asinfo (inside an asadm directory)
+ if [ -f /usr/lib/asadm/asinfo ]; then
+ ln -s /usr/lib/asadm/asinfo /usr/bin/asinfo
+ fi
+ fi
+}
+
+function install_aerospike_server_and_tools() {
+ local pkg_link
+ local sha256
+
+ mkdir -p aerospike/pkg
+
+ if [ "${ARCH}" = "x86_64" ]; then
+ pkg_link="${AEROSPIKE_X86_64_LINK}"
+ sha256="${AEROSPIKE_SHA_X86_64}"
+ elif [ "${ARCH}" = "aarch64" ]; then
+ pkg_link="${AEROSPIKE_AARCH64_LINK}"
+ sha256="${AEROSPIKE_SHA_AARCH64}"
+ else
+ log_warn "Unsuported architecture - ${ARCH}"
+ exit 1
+ fi
+
+ if ! fetch "server/tools tgz" "${pkg_link}" --output aerospike-server.tgz; then
+ log_warn "Could not fetch pkg - ${pkg_link}"
+ exit 1
+ fi
+
+ echo "${sha256} aerospike-server.tgz" | sha256sum -c -
+
+ tar xzf aerospike-server.tgz --strip-components=1 -C aerospike
+
+ install_aerospike_server
+ install_aerospike_tools_subset
+
+ # These directories are required for backward compatibility.
+ mkdir -p /var/{log,run}/aerospike
+
+ # Copy license file to standard location.
+ mkdir -p /licenses
+ cp aerospike/LICENSE /licenses
+
+ rm aerospike-server.tgz
+ rm -rf aerospike
+}
+
+function main() {
+ log_debug "ARCH = '${ARCH}'"
+ log_debug "AEROSPIKE_EDITION = '${AEROSPIKE_EDITION}'"
+ log_debug "AEROSPIKE_X86_64_LINK = '${AEROSPIKE_X86_64_LINK}'"
+ log_debug "AEROSPIKE_SHA_X86_64 = '${AEROSPIKE_SHA_X86_64}'"
+ log_debug "AEROSPIKE_AARCH64_LINK = '${AEROSPIKE_AARCH64_LINK}'"
+ log_debug "AEROSPIKE_SHA_AARCH64 = '${AEROSPIKE_SHA_AARCH64}'"
+
+ install_bootstrap_dependencies
+ install_tini
+ install_aerospike_server_and_tools
+ install_procps
+ remove_bootstrap_dependencies
+}
+
+main
diff --git a/aerospike_ee-6.1.0.3/entrypoint.sh b/aerospike_ce-6.2.0.1/scripts/entrypoint.sh
similarity index 34%
rename from aerospike_ee-6.1.0.3/entrypoint.sh
rename to aerospike_ce-6.2.0.1/scripts/entrypoint.sh
index 9a7ecaf..0e5c1f8 100755
--- a/aerospike_ee-6.1.0.3/entrypoint.sh
+++ b/aerospike_ce-6.2.0.1/scripts/entrypoint.sh
@@ -1,8 +1,9 @@
-#!/bin/bash
-set -e
+#!/usr/bin/env bash
-export FEATURE_KEY_FILE=${FEATURE_KEY_FILE:-/etc/aerospike/features.conf}
-export LOGFILE=${LOGFILE:-/dev/null}
+set -Eeuo pipefail
+
+export FEATURE_KEY_FILE=${FEATURE_KEY_FILE:-"/etc/aerospike/features.conf"}
+export LOGFILE=${LOGFILE:-""}
export SERVICE_ADDRESS=${SERVICE_ADDRESS:-any}
export SERVICE_PORT=${SERVICE_PORT:-3000}
export NAMESPACE=${NAMESPACE:-test}
@@ -11,15 +12,42 @@ export DEFAULT_TTL=${DEFAULT_TTL:-30d}
export MEM_GB=${MEM_GB:-1}
export NSUP_PERIOD=${NSUP_PERIOD:-120}
export STORAGE_GB=${STORAGE_GB:-4}
-if [ "$DATA_IN_MEMORY" == "true" ]; then
+
+if [ "${DATA_IN_MEMORY}" = "true" ]; then
export READ_PAGE_CACHE="false"
else
export READ_PAGE_CACHE="true"
fi
+if asd --version | grep -q "Community"; then
+ unset FEATURE_KEY_FILE # invald for community edition
+fi
+
+function bash_eval_template() {
+ local template_file=$1
+ local target_file=$2
+
+ echo "" >"${target_file}"
+
+ while IFS= read -r line; do
+ if echo "${line}" | grep -qE "[$][(]|[{]"; then
+ local update
+ update=$(eval echo "\"${line}\"") || exit 1
+ echo "${update}" | grep -qE "[^[:space:]]*" && echo "${update}" >>"${target_file}"
+ else
+ echo "${line}" >>"${target_file}"
+ fi
+ done <"${template_file}"
+
+ rm "${template_file}"
+}
+
# Fill out conffile with above values
if [ -f /etc/aerospike/aerospike.template.conf ]; then
- envsubst < /etc/aerospike/aerospike.template.conf > /etc/aerospike/aerospike.conf
+ conf=/etc/aerospike/aerospike.conf
+ template=/etc/aerospike/aerospike.template.conf
+
+ bash_eval_template "${template}" "${conf}"
fi
# if command starts with an option, prepend asd
@@ -29,27 +57,26 @@ fi
# if asd is specified for the command, start it with any given options
if [ "$1" = 'asd' ]; then
-
NETLINK=${NETLINK:-eth0}
-
- # we will wait a bit for the network link to be up.
+ # We will wait a bit for the network link to be up.
NETLINK_UP=0
NETLINK_COUNT=0
- echo "link $NETLINK state $(cat /sys/class/net/${NETLINK}/operstate)"
- while [ $NETLINK_UP -eq 0 ] && [ $NETLINK_COUNT -lt 20 ]; do
- if grep -q "up" /sys/class/net/${NETLINK}/operstate; then
+
+ echo "link ${NETLINK} state $(cat /sys/class/net/"${NETLINK}"/operstate)"
+
+ while [ ${NETLINK_UP} -eq 0 ] && [ ${NETLINK_COUNT} -lt 20 ]; do
+ if grep -q "up" /sys/class/net/"${NETLINK}"/operstate; then
NETLINK_UP=1
else
sleep 0.1
- let NETLINK_COUNT=NETLINK_COUNT+1
+ ((NETLINK_COUNT++))
fi
done
- echo "link $NETLINK state $(cat /sys/class/net/${NETLINK}/operstate) in ${NETLINK_COUNT}"
- # asd should always run in the foreground
+ echo "link ${NETLINK} state $(cat /sys/class/net/"${NETLINK}"/operstate) in ${NETLINK_COUNT}"
+ # asd should always run in the foreground.
set -- "$@" --foreground
-
fi
exec "$@"
diff --git a/aerospike_ee-6.1.0.3/.dockerignore b/aerospike_ee-6.1.0.3/.dockerignore
deleted file mode 100644
index f6acf05..0000000
diff --git a/aerospike_ee-6.1.0.3/Dockerfile b/aerospike_ee-6.2.0.1/Dockerfile
similarity index 23%
rename from aerospike_ee-6.1.0.3/Dockerfile
rename to aerospike_ee-6.2.0.1/Dockerfile
index 5462e3c..874eed4 100644
--- a/aerospike_ee-6.1.0.3/Dockerfile
+++ b/aerospike_ee-6.2.0.1/Dockerfile
@@ -1,68 +1,45 @@
+
#
-# Aerospike Server Enterprise Edition Dockerfile
+# Aerospike Server Dockerfile
#
-# http://github.com/aerospike/aerospike-server-enterprise.docker
+# http://github.com/aerospike/aerospike-server.docker
#
-
FROM debian:bullseye-slim
-ENV AEROSPIKE_VERSION 6.1.0.3
-ENV AEROSPIKE_SHA256 de62082abe7c5fb040fc5eaaed22274142d96cbcd7dfce7530a52d65bce8b277
-ENV AS_TINI_SHA256 d1f6826dd70cdd88dde3d5a20d8ed248883a3bc2caba3071c8a3a9b0e0de5940
+LABEL \
+ maintainer="Aerospike, Inc. <[email protected]>" \
+ name="aerospike-enterprise" \
+ vendor="Aerospike" \
+ version="6.2.0.1" \
+ release="1" \
+ summary="Aerospike Server Enterprise Edition" \
+ description="Aerospike is a real-time database with predictable performance at petabyte scale with microsecond latency over billions of transactions." \
+ io.k8s.display-name="Aerospike Server Enterprise Edition 6.2.0.1" \
+ io.k8s.description="Aerospike is a real-time database with predictable performance at petabyte scale with microsecond latency over billions of transactions."
+
+ARG DEBUG="false"
+
+# AEROSPIKE_EDITION - required - must be "community", "enterprise", or
+# "federal".
+# By selecting "community" you agree to the "COMMUNITY_LICENSE".
+# By selecting "enterprise" you agree to the "ENTERPRISE_LICENSE".
+# By selecting "federal" you agree to the "FEDERAL_LICENSE"
+ARG AEROSPIKE_EDITION="enterprise"
+
+ARG AEROSPIKE_X86_64_LINK="https://artifacts.aerospike.com/aerospike-server-enterprise/6.2.0.1/aerospike-server-enterprise_6.2.0.1_tools-8.0.3_debian11_x86_64.tgz"
+ARG AEROSPIKE_SHA_X86_64="d2a5561a3fcb8ff39ae273fb4e13974f35c3856792a0b2fa307a00e7785508aa"
+ARG AEROSPIKE_AARCH64_LINK="https://artifacts.aerospike.com/aerospike-server-enterprise/6.2.0.1/aerospike-server-enterprise_6.2.0.1_tools-8.0.3_debian11_aarch64.tgz"
+ARG AEROSPIKE_SHA_AARCH64="2d27bd78b38599d8b0c0d1b0daa8b6720a7f6ae1b1a9ad9c50814a7a18ae79ae"
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Install Aerospike Server and Tools
-RUN \
- export DEBIAN_FRONTEND=noninteractive \
- && apt-get update -y \
- && apt-get install -y --no-install-recommends \
- apt-utils \
- 2>&1 | grep -v "delaying package configuration" \
- && apt-get install -y --no-install-recommends \
- binutils \
- ca-certificates \
- gettext-base \
- wget \
- xz-utils \
- # Enterprise only dependencies
- && apt-get install -y --no-install-recommends \
- libcurl4 \
- libldap-2.4.2 \
- && wget https://github.com/aerospike/tini/releases/download/1.0.1/as-tini-static --progress=bar:force:noscroll -O /usr/bin/as-tini-static 2>&1 \
- && echo "$AS_TINI_SHA256 /usr/bin/as-tini-static" | sha256sum -c - \
- && chmod +x /usr/bin/as-tini-static \
- && wget "https://artifacts.aerospike.com/aerospike-server-enterprise/${AEROSPIKE_VERSION}/aerospike-server-enterprise-${AEROSPIKE_VERSION}-debian11.tgz" --progress=bar:force:noscroll -O aerospike-server.tgz 2>&1 \
- && echo "$AEROSPIKE_SHA256 aerospike-server.tgz" | sha256sum -c - \
- && mkdir -p aerospike/pkg \
- && tar xzf aerospike-server.tgz --strip-components=1 -C aerospike \
- && dpkg -i aerospike/aerospike-server-*.deb \
- && ar --output aerospike/pkg -x aerospike/aerospike-tools-*.deb \
- && tar xf aerospike/pkg/data.tar.xz -C aerospike/pkg/ \
- && rm -rf aerospike-server.tgz /var/lib/apt/lists/* \
- && dpkg -r apt-utils binutils ca-certificates wget xz-utils \
- && dpkg --purge apt-utils binutils ca-certificates wget xz-utils 2>&1 \
- && apt-get purge -y \
- && apt-get autoremove -y \
- && find aerospike/pkg/opt/aerospike/bin/ -user aerospike -group aerospike -exec chown root:root {} + \
- && mv aerospike/pkg/etc/aerospike/astools.conf /etc/aerospike \
- # Since tools release 7.0.5, asadm has been moved from /opt/aerospike/bin/asadm to /opt/aerospike/bin/asadm/asadm (inside an asadm directory)
- && if [ -d 'aerospike/pkg/opt/aerospike/bin/asadm' ]; then \
- mv aerospike/pkg/opt/aerospike/bin/asadm /usr/lib/; \
- ln -s /usr/lib/asadm/asadm /usr/bin/asadm; \
- # Since tools release 7.1.1, asinfo has been moved from /opt/aerospike/bin/asinfo to /opt/aerospike/bin/asadm/asinfo (inside an asadm directory)
- if [ -f /usr/lib/asadm/asinfo ]; then \
- ln -s /usr/lib/asadm/asinfo /usr/bin/asinfo; \
- fi \
- fi \
- && rm -rf /opt/aerospike/bin \
- && rm -rf aerospike
-
+COPY scripts/bootstrap.sh /bootstrap.sh
+RUN ./bootstrap.sh && rm bootstrap.sh
# Add the Aerospike configuration specific to this dockerfile
COPY aerospike.template.conf /etc/aerospike/aerospike.template.conf
-COPY entrypoint.sh /entrypoint.sh
# Mount the Aerospike data directory
# VOLUME ["/opt/aerospike/data"]
@@ -78,6 +54,7 @@ COPY entrypoint.sh /entrypoint.sh
#
EXPOSE 3000 3001 3002
+COPY scripts/entrypoint.sh /entrypoint.sh
# Tini init set to restart ASD on SIGUSR1 and terminate ASD on SIGTERM
ENTRYPOINT ["/usr/bin/as-tini-static", "-r", "SIGUSR1", "-t", "SIGTERM", "--", "/entrypoint.sh"]
diff --git a/aerospike_ce-6.1.0.3/aerospike.template.conf b/aerospike_ee-6.2.0.1/aerospike.template.conf
similarity index 79%
rename from aerospike_ce-6.1.0.3/aerospike.template.conf
rename to aerospike_ee-6.2.0.1/aerospike.template.conf
index 6ec328b..6737692 100644
--- a/aerospike_ce-6.1.0.3/aerospike.template.conf
+++ b/aerospike_ee-6.2.0.1/aerospike.template.conf
@@ -7,13 +7,14 @@
# This stanza must come first.
service {
+ $([ -n "${FEATURE_KEY_FILE}" ] && echo "feature-key-file ${FEATURE_KEY_FILE}")
}
logging {
- # Log file must be an absolute path.
- file ${LOGFILE} {
- context any info
- }
+ $([ -n "${LOGFILE}" ] && echo "# Log file must be an absolute path.")
+ $([ -n "${LOGFILE}" ] && echo "file ${LOGFILE} {")
+ $([ -n "${LOGFILE}" ] && echo " context any info")
+ $([ -n "${LOGFILE}" ] && echo "}")
# Send log messages to stdout
console {
@@ -26,7 +27,7 @@ network {
address ${SERVICE_ADDRESS}
port ${SERVICE_PORT}
- # Uncomment the following to set the `access-address` parameter to the
+ # Uncomment the following to set the 'access-address' parameter to the
# IP address of the Docker host. This will the allow the server to correctly
# publish the address which applications and other nodes in the cluster to
# use when addressing this node.
diff --git a/aerospike_ee-6.2.0.1/scripts/bootstrap.sh b/aerospike_ee-6.2.0.1/scripts/bootstrap.sh
new file mode 100755
index 0000000..6e5ce7f
--- /dev/null
+++ b/aerospike_ee-6.2.0.1/scripts/bootstrap.sh
@@ -0,0 +1,198 @@
+#!/usr/bin/env bash
+
+set -Eeuo pipefail
+
+# keep track of the last executed command
+# shellcheck disable=SC2154
+trap 'last_command=${current_command:=""}; current_command=$BASH_COMMAND' DEBUG
+
+# echo an error message before exiting
+# shellcheck disable=SC2154
+trap 'echo "\"${last_command}\" command filed with exit code $?."' EXIT
+
+ARCH="$(uname -m)"
+
+function _log_level() {
+ level=$1
+ msg=$2
+
+ echo -e "${level} ${BASH_SOURCE[2]}:${BASH_LINENO[1]} - ${msg}" >&2
+}
+
+function log_debug() {
+ local msg=$1
+
+ if [ "${DEBUG:=}" = "true" ]; then
+ _log_level "debug" "${msg}"
+ fi
+}
+
+function log_warn() {
+ local msg=$1
+
+ _log_level "warn" "${msg}"
+}
+
+function fetch() {
+ local tag=$1
+ local link=$2
+
+ log_debug "${tag} - ${link}"
+
+ curl -fsSL "${link}" "${@:3}"
+}
+
+function install_bootstrap_dependencies() {
+ export DEBIAN_FRONTEND=noninteractive
+
+ apt-get update -y
+ apt-get install -y --no-install-recommends \
+ apt-utils \
+ 2>&1 | grep -v "delaying package configuration"
+
+ apt-get upgrade -y
+
+ apt-get install -y --no-install-recommends \
+ binutils \
+ ca-certificates \
+ curl \
+ xz-utils
+}
+
+function remove_bootstrap_dependencies() {
+ rm -rf /var/lib/apt/lists/*
+
+ dpkg -r \
+ apt-utils \
+ binutils \
+ ca-certificates \
+ curl \
+ xz-utils
+
+ dpkg --purge \
+ apt-utils \
+ binutils \
+ ca-certificates \
+ curl \
+ xz-utils 2>&1
+
+ apt-get purge -y
+ apt-get autoremove -y
+
+ unset DEBIAN_FRONTEND
+}
+
+function install_procps() {
+ # procps is needed for test using pgrep.
+ apt-get install -y --no-install-recommends procps
+}
+
+function install_tini() {
+ local sha256
+ local suffix
+
+ if [ "${ARCH}" = "x86_64" ]; then
+ sha256=d1f6826dd70cdd88dde3d5a20d8ed248883a3bc2caba3071c8a3a9b0e0de5940
+ suffix=""
+ elif [ "${ARCH}" = "aarch64" ]; then
+ sha256=1c398e5283af2f33888b7d8ac5b01ac89f777ea27c85d25866a40d1e64d0341b
+ suffix="-arm64"
+ else
+ log_warn "Unsuported architecture - ${ARCH}"
+ exit 1
+ fi
+
+ fetch "tini" "https://github.com/aerospike/tini/releases/download/1.0.1/as-tini-static${suffix}" --output /usr/bin/as-tini-static
+
+ echo "${sha256} /usr/bin/as-tini-static" | sha256sum -c -
+ chmod +x /usr/bin/as-tini-static
+}
+
+function install_aerospike_server() {
+ if [ "${AEROSPIKE_EDITION}" = "enterprise" ]; then
+ apt-get install -y --no-install-recommends \
+ libcurl4 \
+ libldap-2.4.2
+ fi
+
+ dpkg -i aerospike/aerospike-server-*.deb
+ rm -rf /opt/aerospike/bin
+}
+
+function install_aerospike_tools_subset() {
+ cd aerospike/pkg # ar on debian10 doesn't support '--output'
+ ar -x ../aerospike-tools*.deb
+ cd -
+ tar xf aerospike/pkg/data.tar.xz -C aerospike/pkg/
+
+ find aerospike/pkg/opt/aerospike/bin/ -user aerospike -group aerospike -exec chown root:root {} +
+ mv aerospike/pkg/etc/aerospike/astools.conf /etc/aerospike
+
+ # Since tools release 7.0.5, asadm has been moved from /opt/aerospike/bin/asadm to /opt/aerospike/bin/asadm/asadm (inside an asadm directory)
+ if [ -d 'aerospike/pkg/opt/aerospike/bin/asadm' ]; then
+ mv aerospike/pkg/opt/aerospike/bin/asadm /usr/lib/
+ ln -s /usr/lib/asadm/asadm /usr/bin/asadm
+
+ # Since tools release 7.1.1, asinfo has been moved from /opt/aerospike/bin/asinfo to /opt/aerospike/bin/asadm/asinfo (inside an asadm directory)
+ if [ -f /usr/lib/asadm/asinfo ]; then
+ ln -s /usr/lib/asadm/asinfo /usr/bin/asinfo
+ fi
+ fi
+}
+
+function install_aerospike_server_and_tools() {
+ local pkg_link
+ local sha256
+
+ mkdir -p aerospike/pkg
+
+ if [ "${ARCH}" = "x86_64" ]; then
+ pkg_link="${AEROSPIKE_X86_64_LINK}"
+ sha256="${AEROSPIKE_SHA_X86_64}"
+ elif [ "${ARCH}" = "aarch64" ]; then
+ pkg_link="${AEROSPIKE_AARCH64_LINK}"
+ sha256="${AEROSPIKE_SHA_AARCH64}"
+ else
+ log_warn "Unsuported architecture - ${ARCH}"
+ exit 1
+ fi
+
+ if ! fetch "server/tools tgz" "${pkg_link}" --output aerospike-server.tgz; then
+ log_warn "Could not fetch pkg - ${pkg_link}"
+ exit 1
+ fi
+
+ echo "${sha256} aerospike-server.tgz" | sha256sum -c -
+
+ tar xzf aerospike-server.tgz --strip-components=1 -C aerospike
+
+ install_aerospike_server
+ install_aerospike_tools_subset
+
+ # These directories are required for backward compatibility.
+ mkdir -p /var/{log,run}/aerospike
+
+ # Copy license file to standard location.
+ mkdir -p /licenses
+ cp aerospike/LICENSE /licenses
+
+ rm aerospike-server.tgz
+ rm -rf aerospike
+}
+
+function main() {
+ log_debug "ARCH = '${ARCH}'"
+ log_debug "AEROSPIKE_EDITION = '${AEROSPIKE_EDITION}'"
+ log_debug "AEROSPIKE_X86_64_LINK = '${AEROSPIKE_X86_64_LINK}'"
+ log_debug "AEROSPIKE_SHA_X86_64 = '${AEROSPIKE_SHA_X86_64}'"
+ log_debug "AEROSPIKE_AARCH64_LINK = '${AEROSPIKE_AARCH64_LINK}'"
+ log_debug "AEROSPIKE_SHA_AARCH64 = '${AEROSPIKE_SHA_AARCH64}'"
+
+ install_bootstrap_dependencies
+ install_tini
+ install_aerospike_server_and_tools
+ install_procps
+ remove_bootstrap_dependencies
+}
+
+main
diff --git a/aerospike_ce-6.1.0.3/entrypoint.sh b/aerospike_ee-6.2.0.1/scripts/entrypoint.sh
similarity index 34%
rename from aerospike_ce-6.1.0.3/entrypoint.sh
rename to aerospike_ee-6.2.0.1/scripts/entrypoint.sh
index 2f07baf..0e5c1f8 100755
--- a/aerospike_ce-6.1.0.3/entrypoint.sh
+++ b/aerospike_ee-6.2.0.1/scripts/entrypoint.sh
@@ -1,7 +1,9 @@
-#!/bin/bash
-set -e
+#!/usr/bin/env bash
-export LOGFILE=${LOGFILE:-/dev/null}
+set -Eeuo pipefail
+
+export FEATURE_KEY_FILE=${FEATURE_KEY_FILE:-"/etc/aerospike/features.conf"}
+export LOGFILE=${LOGFILE:-""}
export SERVICE_ADDRESS=${SERVICE_ADDRESS:-any}
export SERVICE_PORT=${SERVICE_PORT:-3000}
export NAMESPACE=${NAMESPACE:-test}
@@ -10,15 +12,42 @@ export DEFAULT_TTL=${DEFAULT_TTL:-30d}
export MEM_GB=${MEM_GB:-1}
export NSUP_PERIOD=${NSUP_PERIOD:-120}
export STORAGE_GB=${STORAGE_GB:-4}
-if [ "$DATA_IN_MEMORY" == "true" ]; then
+
+if [ "${DATA_IN_MEMORY}" = "true" ]; then
export READ_PAGE_CACHE="false"
else
export READ_PAGE_CACHE="true"
fi
+if asd --version | grep -q "Community"; then
+ unset FEATURE_KEY_FILE # invald for community edition
+fi
+
+function bash_eval_template() {
+ local template_file=$1
+ local target_file=$2
+
+ echo "" >"${target_file}"
+
+ while IFS= read -r line; do
+ if echo "${line}" | grep -qE "[$][(]|[{]"; then
+ local update
+ update=$(eval echo "\"${line}\"") || exit 1
+ echo "${update}" | grep -qE "[^[:space:]]*" && echo "${update}" >>"${target_file}"
+ else
+ echo "${line}" >>"${target_file}"
+ fi
+ done <"${template_file}"
+
+ rm "${template_file}"
+}
+
# Fill out conffile with above values
if [ -f /etc/aerospike/aerospike.template.conf ]; then
- envsubst < /etc/aerospike/aerospike.template.conf > /etc/aerospike/aerospike.conf
+ conf=/etc/aerospike/aerospike.conf
+ template=/etc/aerospike/aerospike.template.conf
+
+ bash_eval_template "${template}" "${conf}"
fi
# if command starts with an option, prepend asd
@@ -28,27 +57,26 @@ fi
# if asd is specified for the command, start it with any given options
if [ "$1" = 'asd' ]; then
-
NETLINK=${NETLINK:-eth0}
-
- # we will wait a bit for the network link to be up.
+ # We will wait a bit for the network link to be up.
NETLINK_UP=0
NETLINK_COUNT=0
- echo "link $NETLINK state $(cat /sys/class/net/${NETLINK}/operstate)"
- while [ $NETLINK_UP -eq 0 ] && [ $NETLINK_COUNT -lt 20 ]; do
- if grep -q "up" /sys/class/net/${NETLINK}/operstate; then
+
+ echo "link ${NETLINK} state $(cat /sys/class/net/"${NETLINK}"/operstate)"
+
+ while [ ${NETLINK_UP} -eq 0 ] && [ ${NETLINK_COUNT} -lt 20 ]; do
+ if grep -q "up" /sys/class/net/"${NETLINK}"/operstate; then
NETLINK_UP=1
else
sleep 0.1
- let NETLINK_COUNT=NETLINK_COUNT+1
+ ((NETLINK_COUNT++))
fi
done
- echo "link $NETLINK state $(cat /sys/class/net/${NETLINK}/operstate) in ${NETLINK_COUNT}"
- # asd should always run in the foreground
+ echo "link ${NETLINK} state $(cat /sys/class/net/"${NETLINK}"/operstate) in ${NETLINK_COUNT}"
+ # asd should always run in the foreground.
set -- "$@" --foreground
-
fi
exec "$@"
Relevant Maintainers:
-
aerospike: @volmarl @mcoberly2 @pvinh-spike
Would you please also delete the "latest" build from the tag listing: https://hub.docker.com/_/aerospike/tags
Yeah, we have deleted the latest tag from Docker Hub.
Unfortunately the new bootstrap.sh falls under this section of our README:
It may be tempting, for the sake of brevity, to put complicated initialization details into a standalone script and merely add a
RUNcommand in theDockerfile. However, this causes the resultingDockerfileto be overly opaque, and suchDockerfiles are unlikely to pass review. Instead, it is recommended to put all the commands for initialization into theDockerfileas appropriateRUNorENVcommand combinations.-https://github.com/docker-library/official-images/tree/6f8c8066b90e4f81d999d088f4081cc1723b2387#clarity
Edit: accidental close :arrow_down: :facepalm:
Closing, will replace with Version 6.2.0.2 shortly