From df7edf6356cc0554eaa831100284a8176a08d69a Mon Sep 17 00:00:00 2001 From: Trilok Nallani <54312499+Trilokkumar1@users.noreply.github.com> Date: Sun, 17 Aug 2025 21:36:51 +0530 Subject: [PATCH 1/4] updated base image with latest deb --- 3.4.3-deb-clouseau/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3.4.3-deb-clouseau/Dockerfile b/3.4.3-deb-clouseau/Dockerfile index 8621ee5..2c72461 100644 --- a/3.4.3-deb-clouseau/Dockerfile +++ b/3.4.3-deb-clouseau/Dockerfile @@ -10,7 +10,7 @@ # License for the specific language governing permissions and limitations under # the License. -FROM debian:bookworm-slim +FROM debian:trixie-slim ARG CLOUSEAU_VERSION=2.25.0 ARG SLF4J_SIMPLE_BINDING_VERSION=2.0.7 From ac5bbcdf1200f813cbfb5db07cc555184c60e440 Mon Sep 17 00:00:00 2001 From: Trilok Nallani <54312499+Trilokkumar1@users.noreply.github.com> Date: Sun, 17 Aug 2025 21:49:06 +0530 Subject: [PATCH 2/4] commented apt-key which is not supported in latest deb --- 3.4.3-deb-clouseau/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3.4.3-deb-clouseau/Dockerfile b/3.4.3-deb-clouseau/Dockerfile index 2c72461..38f180f 100644 --- a/3.4.3-deb-clouseau/Dockerfile +++ b/3.4.3-deb-clouseau/Dockerfile @@ -76,7 +76,7 @@ RUN set -eux; \ gpg --batch --export "${GPG_COUCH_KEY}" > /usr/share/keyrings/couchdb-archive-keyring.gpg; \ command -v gpgconf && gpgconf --kill all || :; \ rm -rf "$GNUPGHOME"; \ - apt-key list; \ + #apt-key list; \ apt purge -y --autoremove curl; \ rm -rf /var/lib/apt/lists/* From 2b5a5fb90c301b44157dc01fea604fd73f6e916e Mon Sep 17 00:00:00 2001 From: Trilok Nallani <54312499+Trilokkumar1@users.noreply.github.com> Date: Sun, 17 Aug 2025 22:50:50 +0530 Subject: [PATCH 3/4] get couchdb from bookworm main --- 3.4.3-deb-clouseau/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3.4.3-deb-clouseau/Dockerfile b/3.4.3-deb-clouseau/Dockerfile index 38f180f..30b22dd 100644 --- a/3.4.3-deb-clouseau/Dockerfile +++ b/3.4.3-deb-clouseau/Dockerfile @@ -83,7 +83,7 @@ RUN set -eux; \ ENV COUCHDB_VERSION 3.4.3 RUN . /etc/os-release; \ - echo "deb [signed-by=/usr/share/keyrings/couchdb-archive-keyring.gpg] https://apache.jfrog.io/artifactory/couchdb-deb/ ${VERSION_CODENAME} main" | \ + echo "deb [signed-by=/usr/share/keyrings/couchdb-archive-keyring.gpg] https://apache.jfrog.io/artifactory/couchdb-deb/ bookworm main main" | \ tee /etc/apt/sources.list.d/couchdb.list >/dev/null # https://github.com/apache/couchdb-pkg/blob/master/debian/README.Debian From 57c997595c40b95ce738de5a095c13103bca391d Mon Sep 17 00:00:00 2001 From: jenkins Date: Thu, 21 Aug 2025 05:02:40 -0700 Subject: [PATCH 4/4] added support for alpine --- 3.4.3-alpine-clouseau/Dockerfile | 164 ++++++++++++++ 3.4.3-alpine-clouseau/Dockerfile.alpine | 82 +++++++ 3.4.3-alpine-clouseau/docker-entrypoint.sh | 172 +++++++++++++++ 3.4.3-alpine-clouseau/keys.asc | 64 ++++++ 3.4.3-alpine-clouseau/licenses/LICENSE | 202 ++++++++++++++++++ 3.4.3-alpine-clouseau/local.ini | 30 +++ .../resources/10-docker-default.ini | 8 + .../resources/clouseau/clouseau.ini | 4 + .../resources/clouseau/clouseau.sh | 12 ++ .../clouseau/simplelogger.properties | 34 +++ 3.4.3-alpine-clouseau/resources/pre_stop | 30 +++ 3.4.3-alpine-clouseau/resources/run | 1 + 3.4.3-alpine-clouseau/resources/run_clouseau | 1 + 3.4.3-alpine-clouseau/resources/vm.args | 47 ++++ 14 files changed, 851 insertions(+) create mode 100644 3.4.3-alpine-clouseau/Dockerfile create mode 100644 3.4.3-alpine-clouseau/Dockerfile.alpine create mode 100755 3.4.3-alpine-clouseau/docker-entrypoint.sh create mode 100644 3.4.3-alpine-clouseau/keys.asc create mode 100644 3.4.3-alpine-clouseau/licenses/LICENSE create mode 100644 3.4.3-alpine-clouseau/local.ini create mode 100644 3.4.3-alpine-clouseau/resources/10-docker-default.ini create mode 100644 3.4.3-alpine-clouseau/resources/clouseau/clouseau.ini create mode 100644 3.4.3-alpine-clouseau/resources/clouseau/clouseau.sh create mode 100644 3.4.3-alpine-clouseau/resources/clouseau/simplelogger.properties create mode 100644 3.4.3-alpine-clouseau/resources/pre_stop create mode 100644 3.4.3-alpine-clouseau/resources/run create mode 100644 3.4.3-alpine-clouseau/resources/run_clouseau create mode 100644 3.4.3-alpine-clouseau/resources/vm.args diff --git a/3.4.3-alpine-clouseau/Dockerfile b/3.4.3-alpine-clouseau/Dockerfile new file mode 100644 index 0000000..75ca0a9 --- /dev/null +++ b/3.4.3-alpine-clouseau/Dockerfile @@ -0,0 +1,164 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +FROM debian:bookworm-slim + +ARG CLOUSEAU_VERSION=2.25.0 +ARG SLF4J_SIMPLE_BINDING_VERSION=2.0.7 +ARG SLF4J_API_BINDING_VERSION=2.0.7 + +LABEL maintainer="CouchDB Developers dev@couchdb.apache.org" + +# Add CouchDB user account to make sure the IDs are assigned consistently +RUN groupadd -g 5984 -r couchdb && useradd -u 5984 -d /opt/couchdb -g couchdb couchdb \ + && echo "couchdb ALL=(ALL) NOPASSWD: ALL" | tee -a /etc/sudoers + +# be sure GPG and apt-transport-https are available and functional +RUN set -ex; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + apt-transport-https \ + ca-certificates \ + dirmngr \ + gnupg \ + ; \ + rm -rf /var/lib/apt/lists/* + +# grab tini for signal handling and zombie reaping +# see https://github.com/apache/couchdb-docker/pull/28#discussion_r141112407 +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends tini; \ + rm -rf /var/lib/apt/lists/*; \ + tini --version + +# Fetch and extract Clouseau (Debian Bookworm version) +RUN set -xe; \ + apt-get update -y && \ + apt-get install -y --no-install-recommends unzip wget maven && \ + mkdir -p /opt/couchdb-search/lib && \ + wget https://github.com/cloudant-labs/clouseau/releases/download/${CLOUSEAU_VERSION}/clouseau-${CLOUSEAU_VERSION}-dist.zip && \ + unzip -j clouseau-${CLOUSEAU_VERSION}-dist.zip -d /opt/couchdb-search/lib/ && \ + rm -f /opt/couchdb-search/lib/slf4j-api-1.7.2.jar && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +RUN mvn dependency:get -Dartifact=org.slf4j:slf4j-simple:${SLF4J_SIMPLE_BINDING_VERSION} -Dartifact=org.slf4j:slf4j-api:${SLF4J_API_BINDING_VERSION} && \ + mvn dependency:copy -Dartifact=org.slf4j:slf4j-simple:${SLF4J_SIMPLE_BINDING_VERSION}:jar -DoutputDirectory=/opt/couchdb-search/lib && \ + mvn dependency:copy -Dartifact=org.slf4j:slf4j-api:${SLF4J_API_BINDING_VERSION}:jar -DoutputDirectory=/opt/couchdb-search/lib + +RUN wget http://www.mirbsd.org/~tg/Debs/sources.txt/wtf-bookworm.sources; \ + mkdir -p /etc/apt/sources.list.d; \ + mv wtf-bookworm.sources /etc/apt/sources.list.d/; \ + apt-get update -y; \ + apt-get install -y --no-install-recommends openjdk-8-jdk-headless apt-transport-https ca-certificates runit; \ + cp /etc/runit/2 /sbin/runsvdir-start; + +# http://docs.couchdb.org/en/latest/install/unix.html#installing-the-apache-couchdb-packages +ENV GPG_COUCH_KEY \ +# gpg: rsa8192 205-01-19 The Apache Software Foundation (Package repository signing key) + 390EF70BB1EA12B2773962950EE62FB37A00258D +RUN set -eux; \ + apt-get update; \ + apt-get install -y curl; \ + export GNUPGHOME="$(mktemp -d)"; \ + curl -fL -o keys.asc https://couchdb.apache.org/repo/keys.asc; \ + gpg --batch --import keys.asc; \ + gpg --batch --export "${GPG_COUCH_KEY}" > /usr/share/keyrings/couchdb-archive-keyring.gpg; \ + command -v gpgconf && gpgconf --kill all || :; \ + rm -rf "$GNUPGHOME"; \ + #apt-key list; \ + apt purge -y --autoremove curl; \ + rm -rf /var/lib/apt/lists/* + +ENV COUCHDB_VERSION 3.4.3 + +RUN . /etc/os-release; \ + echo "deb [signed-by=/usr/share/keyrings/couchdb-archive-keyring.gpg] https://apache.jfrog.io/artifactory/couchdb-deb/ bookworm main main" | \ + tee /etc/apt/sources.list.d/couchdb.list >/dev/null + +# https://github.com/apache/couchdb-pkg/blob/master/debian/README.Debian +RUN set -eux; \ + apt-get update; \ + \ + echo "couchdb couchdb/mode select none" | debconf-set-selections; \ + # we DO want recommends this time + DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-downgrades --allow-remove-essential --allow-change-held-packages \ + couchdb="$COUCHDB_VERSION"~bookworm \ + ; \ + # Undo symlinks to /var/log and /var/lib + rmdir /var/lib/couchdb /var/log/couchdb; \ + rm /opt/couchdb/data /opt/couchdb/var/log; \ + mkdir -p /opt/couchdb/data /opt/couchdb/var/log; \ + chown couchdb:couchdb /opt/couchdb/data /opt/couchdb/var/log; \ + chmod 777 /opt/couchdb/data /opt/couchdb/var/log; \ + # Remove file that sets logging to a file + rm /opt/couchdb/etc/default.d/10-filelog.ini; \ + # Check we own everything in /opt/couchdb. Matches the command in dockerfile_entrypoint.sh + find /opt/couchdb \! \( -user couchdb -group couchdb \) -exec chown -f couchdb:couchdb '{}' +; \ + # Setup directories and permissions for config. Technically these could be 555 and 444 respectively + # but we keep them as 755 and 644 for consistency with CouchDB defaults and the dockerfile_entrypoint.sh. + find /opt/couchdb/etc -type d ! -perm 0755 -exec chmod -f 0755 '{}' +; \ + find /opt/couchdb/etc -type f ! -perm 0644 -exec chmod -f 0644 '{}' +; \ + # only local.d needs to be writable for the docker_entrypoint.sh + chmod -f 0777 /opt/couchdb/etc/local.d; \ + # apt clean-up + rm -rf /var/lib/apt/lists/*; + +# Copy Clouseau jar and set directory permissions +# @TODO: Should we push local.ini from the config-store repo? +COPY --chown=couchdb:0 resources/clouseau/clouseau.ini /opt/couchdb-search/etc/ +COPY --chown=couchdb:0 resources/clouseau/simplelogger.properties /opt/couchdb-search/lib/ + +RUN install -d -m 0755 -o couchdb -g 0 -p /opt/couchdb-search/etc /opt/couchdb-search/lib /opt/couchdb/data/search_indexes && \ + find -L /opt/couchdb-search \! \( -user couchdb -group 0 \) -exec chown -f couchdb:0 '{}' +; \ + find -L /opt/couchdb-search -type d ! -perm 0755 -exec chmod -f 0755 '{}' +; \ + find -L /opt/couchdb-search -type f ! -perm 0664 -exec chmod -f 0664 '{}' +; + +RUN install -d -m 0775 -o couchdb -g 0 -p /opt/couchdb/etc /opt/couchdb/data /opt/couchdb/bin && \ + find -L /opt/couchdb \! \( -user couchdb -group 0 \) -exec chown -f couchdb:0 '{}' +; \ + find -L /opt/couchdb -type d ! -perm 0775 -exec chmod -f 0775 '{}' +; \ + find -L /opt/couchdb -type f ! -perm 0775 -exec chmod -f 0775 '{}' +; + +RUN install -d -m 0775 -o couchdb -g 0 -p /run/runit /etc/service && \ + find -L /run/runit -type d ! -perm 0775 -exec chmod -f 0775 '{}' +; \ + find -L /run/runit -type f ! -perm 0775 -exec chmod -f 0775 '{}' +; \ + find -L /etc/service -type d ! -perm 0775 -exec chmod -f 0775 '{}' +; \ + find -L /etc/service -type f ! -perm 0775 -exec chmod -f 0775 '{}' +; + +# Add the License +COPY licenses /licenses + +# Add configuration +COPY --chown=couchdb:0 resources/10-docker-default.ini /opt/couchdb/etc/default.d/ +COPY --chown=couchdb:0 resources/vm.args /opt/couchdb/etc/ +COPY --chown=couchdb:0 resources/run /etc/service/couchdb/ +COPY --chown=couchdb:0 resources/run_clouseau /etc/service/couchdb-search/run + +# @TODO: Should we push local.ini from the config-store repo? +COPY --chown=couchdb:0 local.ini /opt/couchdb/etc/local.d/ + +COPY --chown=couchdb:0 docker-entrypoint.sh /usr/local/bin +RUN ln -s usr/local/bin/docker-entrypoint.sh /docker-entrypoint.sh # backwards compat + +USER couchdb:root + +ENTRYPOINT ["tini", "-s", "--", "/docker-entrypoint.sh"] + +VOLUME /opt/couchdb/data + +# 5984: Main CouchDB endpoint +# 4369: Erlang portmap daemon (epmd) +# 9100: CouchDB cluster communication port +EXPOSE 5984 4369 9100 +CMD ["/opt/couchdb/bin/couchdb"] + diff --git a/3.4.3-alpine-clouseau/Dockerfile.alpine b/3.4.3-alpine-clouseau/Dockerfile.alpine new file mode 100644 index 0000000..4c0fabb --- /dev/null +++ b/3.4.3-alpine-clouseau/Dockerfile.alpine @@ -0,0 +1,82 @@ +FROM alpine:3.22 + +LABEL maintainer="CouchDB Developers " + +ARG COUCHDB_VERSION=3.5.0 +ARG CLOUSEAU_VERSION=2.25.0 +ARG SLF4J_SIMPLE_BINDING_VERSION=2.0.7 +ARG SLF4J_API_BINDING_VERSION=2.0.7 + +# Add CouchDB user and group +RUN addgroup -g 5984 couchdb && \ + adduser -D -u 5984 -h /opt/couchdb -G couchdb couchdb + +# Install build/runtime dependencies (minimal working set) +RUN apk update && apk add --no-cache \ + build-base \ + erlang \ + erlang-reltool \ + erlang-dev \ + curl \ + wget \ + git \ + python3 \ + py3-pip \ + icu-dev \ + openssl-dev \ + ncurses-dev \ + mozjs-dev \ + bash sudo tini runit maven openjdk8 unzip + +# Build CouchDB from source +WORKDIR /src +RUN wget https://downloads.apache.org/couchdb/source/${COUCHDB_VERSION}/apache-couchdb-${COUCHDB_VERSION}.tar.gz && \ + tar xzf apache-couchdb-${COUCHDB_VERSION}.tar.gz && \ + cd apache-couchdb-${COUCHDB_VERSION} && \ + ./configure --disable-docs --spidermonkey-version 128 && \ + make release + +# Move compiled CouchDB release to /opt/couchdb and set permissions +RUN mv /src/apache-couchdb-${COUCHDB_VERSION}/rel/couchdb /opt/couchdb && \ + chown -R couchdb:couchdb /opt/couchdb && \ + chmod -R 0770 /opt/couchdb + +# Fetch and extract Clouseau +RUN mkdir -p /opt/couchdb-search/lib /opt/couchdb-search/etc && \ + wget https://github.com/cloudant-labs/clouseau/releases/download/${CLOUSEAU_VERSION}/clouseau-${CLOUSEAU_VERSION}-dist.zip && \ + unzip -j clouseau-${CLOUSEAU_VERSION}-dist.zip -d /opt/couchdb-search/lib/ && \ + rm clouseau-${CLOUSEAU_VERSION}-dist.zip && \ + rm -f /opt/couchdb-search/lib/slf4j-api-1.7.2.jar + +# Fix SLF4J dependencies using Maven +RUN mvn dependency:get -Dartifact=org.slf4j:slf4j-simple:${SLF4J_SIMPLE_BINDING_VERSION} -Dartifact=org.slf4j:slf4j-api:${SLF4J_API_BINDING_VERSION} && \ + mvn dependency:copy -Dartifact=org.slf4j:slf4j-simple:${SLF4J_SIMPLE_BINDING_VERSION}:jar -DoutputDirectory=/opt/couchdb-search/lib && \ + mvn dependency:copy -Dartifact=org.slf4j:slf4j-api:${SLF4J_API_BINDING_VERSION}:jar -DoutputDirectory=/opt/couchdb-search/lib + +# Set ownership and permissions for Clouseau +RUN chown -R couchdb:couchdb /opt/couchdb-search && \ + chmod -R 0775 /opt/couchdb-search + +# Copy configuration files (these must be included in build context) +COPY --chown=couchdb:couchdb resources/clouseau/clouseau.ini /opt/couchdb-search/etc/ +COPY --chown=couchdb:couchdb resources/clouseau/simplelogger.properties /opt/couchdb-search/lib/ +COPY --chown=couchdb:couchdb resources/10-docker-default.ini /opt/couchdb/etc/default.d/ +COPY --chown=couchdb:couchdb resources/vm.args /opt/couchdb/etc/ +COPY --chown=couchdb:couchdb resources/run /etc/service/couchdb/run +COPY --chown=couchdb:couchdb resources/run_clouseau /etc/service/couchdb-search/run + +COPY --chown=couchdb:couchdb local.ini /opt/couchdb/etc/local.d/ +COPY --chown=couchdb:couchdb docker-entrypoint.sh /usr/local/bin/ +RUN ln -s /usr/local/bin/docker-entrypoint.sh /docker-entrypoint.sh + +# Set user and working directory +USER couchdb +WORKDIR /opt/couchdb + +VOLUME /opt/couchdb/data + +EXPOSE 5984 4369 9100 + +ENTRYPOINT ["tini", "-s", "--", "/docker-entrypoint.sh"] +CMD ["/opt/couchdb/bin/couchdb"] + diff --git a/3.4.3-alpine-clouseau/docker-entrypoint.sh b/3.4.3-alpine-clouseau/docker-entrypoint.sh new file mode 100755 index 0000000..a00901f --- /dev/null +++ b/3.4.3-alpine-clouseau/docker-entrypoint.sh @@ -0,0 +1,172 @@ +#!/bin/sh +# Licensed under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +set -e + +# first arg is `-something` or `+something` +if [ "${1#-}" != "$1" ] || [ "${1#+}" != "$1" ]; then + set -- /opt/couchdb/bin/couchdb "$@" +fi + +# first arg is the bare word `couchdb` +if [ "$1" = 'couchdb' ]; then + shift + set -- /opt/couchdb/bin/couchdb "$@" +fi + +if [ "$1" = '/opt/couchdb/bin/couchdb' ]; then + # Ensure directory and config file exist for runtime changes + mkdir -p /opt/couchdb/etc/local.d + touch /opt/couchdb/etc/local.d/docker.ini + + if [ "$(id -u)" = "0" ]; then + # Fix ownership for /opt/couchdb + find /opt/couchdb \! \( -user couchdb -group couchdb \) -exec chown -f couchdb:couchdb '{}' + + find /opt/couchdb/data -type d ! -perm 0755 -exec chmod -f 0755 '{}' + + find /opt/couchdb/data -type f ! -perm 0644 -exec chmod -f 0644 '{}' + + find /opt/couchdb/etc -type d ! -perm 0755 -exec chmod -f 0755 '{}' + + find /opt/couchdb/etc -type f ! -perm 0644 -exec chmod -f 0644 '{}' + + find -L /opt/couchdb-search \! \( -user couchdb -group 0 \) -exec chown -f couchdb:0 '{}' + + find -L /opt/couchdb-search -type d ! -perm 0755 -exec chmod -f 0755 '{}' + + find -L /opt/couchdb-search -type f ! -perm 0644 -exec chmod -f 0644 '{}' + + fi + + # Erlang cookie setup + kCOOKIE_REGEX='setcookie ([^ ]+)' + cookie='' + cookieFile='/opt/couchdb/.erlang.cookie' + if [ -e "$cookieFile" ]; then + cookieFileContents="$(cat "$cookieFile" 2>/dev/null)" + fi + + # If ERL_FLAGS specifies cookie, use it + case "$ERL_FLAGS" in + *-setcookie*) + cookie=$(echo "$ERL_FLAGS" | sed -n 's/.*-setcookie \([^ ]*\).*/\1/p') + ;; + *) + if [ ! -z "$COUCHDB_ERLANG_COOKIE" ]; then + if [ -n "$cookieFileContents" ] && [ "$cookieFileContents" != "$COUCHDB_ERLANG_COOKIE" ]; then + echo >&2 + echo >&2 "warning: $cookieFile contents do not match COUCHDB_ERLANG_COOKIE" + echo >&2 + fi + cookie=$COUCHDB_ERLANG_COOKIE + elif [ -n "$cookieFileContents" ]; then + cookie=$cookieFileContents + else + cookie=$(cat /proc/sys/kernel/random/uuid) + fi + ERL_FLAGS="$ERL_FLAGS -setcookie $cookie" + ;; + esac + + # Write cookie to Clouseau config if missing + if ! grep -q '^cookie=' /opt/couchdb-search/etc/clouseau.ini 2>/dev/null; then + echo "cookie=$cookie" >>/opt/couchdb-search/etc/clouseau.ini + fi + + # Setup Erlang node name in vm.args + nodename=${NODENAME:-127.0.0.1} + if ! echo "$ERL_FLAGS" | grep -q -- '-name' && \ + ! grep -q -- '-name' /opt/couchdb/etc/vm.args 2>/dev/null; then + echo "-name couchdb@$nodename" >>/opt/couchdb/etc/vm.args + fi + + # Add admin user and secret if provided via environment and missing in config + if [ ! -z "$COUCHDB_USER" ] && [ ! -z "$COUCHDB_PASSWORD" ]; then + if ! grep -q "^\[admins\]" /opt/couchdb/etc/local.d/*.ini 2>/dev/null || \ + ! grep -q "^$COUCHDB_USER =" /opt/couchdb/etc/local.d/*.ini 2>/dev/null; then + printf "\n[admins]\n%s = %s\n" "$COUCHDB_USER" "$COUCHDB_PASSWORD" >>/opt/couchdb/etc/local.d/docker.ini + fi + fi + + if [ ! -z "$COUCHDB_SECRET" ]; then + if ! grep -q "^\[chttpd_auth\]" /opt/couchdb/etc/local.d/*.ini 2>/dev/null || \ + ! grep -q "^secret =" /opt/couchdb/etc/local.d/*.ini 2>/dev/null; then + printf "\n[chttpd_auth]\nsecret = %s\n" "$COUCHDB_SECRET" >>/opt/couchdb/etc/local.d/docker.ini + fi + fi + + # Write erlang cookie file if COUCHDB_ERLANG_COOKIE provided + if [ ! -z "$COUCHDB_ERLANG_COOKIE" ]; then + if [ ! -f "$cookieFile" ] || [ "$(cat "$cookieFile" 2>/dev/null)" != "$COUCHDB_ERLANG_COOKIE" ]; then + echo "$COUCHDB_ERLANG_COOKIE" > "$cookieFile" + fi + chown couchdb:couchdb "$cookieFile" + chmod 600 "$cookieFile" + fi + + if [ "$(id -u)" = '0' ]; then + chown -f couchdb:couchdb /opt/couchdb/etc/local.d/docker.ini || true + fi + + # Verify presence of admins section with at least one admin user + # Using POSIX grep alternative to confirm non-comment line under [admins] + if ! grep -q "^\[admins\]" /opt/couchdb/etc/default.d/*.ini /opt/couchdb/etc/local.d/*.ini 2>/dev/null || ! \ + grep -qv "^\s*;" /opt/couchdb/etc/local.d/docker.ini 2>/dev/null; then + cat >&2 <<-'EOWARN' +************************************************************* +ERROR: CouchDB 3.0+ will no longer run in "Admin Party" + mode. You *MUST* specify an admin user and + password, either via your own .ini file mapped + into the container at /opt/couchdb/etc/local.ini + or inside /opt/couchdb/etc/local.d, or with + "-e COUCHDB_USER=admin -e COUCHDB_PASSWORD=password" + to set it via "docker run". +************************************************************* +EOWARN + exit 1 + fi + + echo "Starting CouchDB... ERL_FLAGS=$ERL_FLAGS will be used." + export HOME=/opt/couchdb + if [ "$(id -u)" = '0' ]; then + chpst -u couchdb env ERL_FLAGS="$ERL_FLAGS" "$@" & + else + chpst env ERL_FLAGS="$ERL_FLAGS" "$@" & + fi + + echo "Starting CouchDB Search (Clouseau)..." + export HOME=/opt/couchdb-search + + # Using 'java' in PATH for Alpine compatibility + if [ "$(id -u)" = '0' ]; then + chpst -u couchdb java -server \ + -Xmx2G \ + -Dsun.net.inetaddr.ttl=30 \ + -Dsun.net.inetaddr.negative.ttl=30 \ + -Dlog4j.configuration=file:/opt/couchdb-search/lib/simplelogger.properties \ + -XX:OnOutOfMemoryError="kill -9 %p" \ + -XX:+UseConcMarkSweepGC \ + -XX:+CMSParallelRemarkEnabled \ + -classpath "/opt/couchdb-search/lib/*" \ + com.cloudant.clouseau.Main \ + /opt/couchdb-search/etc/clouseau.ini & + else + chpst java -server \ + -Xmx2G \ + -Dsun.net.inetaddr.ttl=30 \ + -Dsun.net.inetaddr.negative.ttl=30 \ + -Dlog4j.configuration=file:/opt/couchdb-search/lib/simplelogger.properties \ + -XX:OnOutOfMemoryError="kill -9 %p" \ + -XX:+UseConcMarkSweepGC \ + -XX:+CMSParallelRemarkEnabled \ + -classpath "/opt/couchdb-search/lib/*" \ + com.cloudant.clouseau.Main \ + /opt/couchdb-search/etc/clouseau.ini & + fi + + wait +fi + diff --git a/3.4.3-alpine-clouseau/keys.asc b/3.4.3-alpine-clouseau/keys.asc new file mode 100644 index 0000000..b70b985 --- /dev/null +++ b/3.4.3-alpine-clouseau/keys.asc @@ -0,0 +1,64 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG/MacGPG2 v2.0.22 (Darwin) +Comment: GPGTools - https://gpgtools.org + +mQQNBFS9JYkBIAC/0ol2lpWq2l/fSkiNqZWaslxO6VgHITtd2C6mEXo/DnRPL7Rz +GfTbpUhzZmKFaUquJdq5Ed7qDYgJcbTJsSSJoWvbidl1peEjyrUFh9h1V+ow3ueK ++4VJwJCm4DtYPgqrJrSNW2nNRcx0XdwUCYC3YlIAa8vvVYniYB8OTv7BYZu7wKa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rhcOTpDA62MdYR5D37AoQTZvDytOV9JvqWj9qima89eJCaMbjdNrmQggiEv +1US1pxHUgEqM0Zo2mDCA7tA64gjhoHVvwqdCKX/sKw7XAzeLX3l3GHbuW5JT+zcK +gsQ24W/sgi5zpKmlWkR8rtwRHdJyvZpLnQJUxsXfK9TuuwAKvEmOCup+IthaGmWq +LZxCypOGtUpFC9yDxUtEOe5KFJ5DWJ/fpwk9LDt5RRiro9wLMKksaZsi++dDDdBX +nxzxVcj7HXSLbpXTxo6ZhzzLHNFtDHYmhNhJDDPJIQO/lBr7/hIwmFfcBAuimMZI +a7iaf/ZM3apksz3p +=Kn6W +-----END PGP PUBLIC KEY BLOCK----- diff --git a/3.4.3-alpine-clouseau/licenses/LICENSE b/3.4.3-alpine-clouseau/licenses/LICENSE new file mode 100644 index 0000000..f6cd2bc --- /dev/null +++ b/3.4.3-alpine-clouseau/licenses/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/3.4.3-alpine-clouseau/local.ini b/3.4.3-alpine-clouseau/local.ini new file mode 100644 index 0000000..b7e5562 --- /dev/null +++ b/3.4.3-alpine-clouseau/local.ini @@ -0,0 +1,30 @@ +; CouchDB Configuration Settings + +; Custom settings should be made in this file. They will override settings +; in default.ini, but unlike changes made to default.ini, this file won't be +; overwritten on server upgrade. + +[couchdb] +database_dir = /data/couchdb +view_index_dir = /data/couchdb +max_document_size = 4294967296 ; bytes +os_process_timeout = 30000 +single_node = true + + +[cluster] +; All data is stored on the single node +n = 1 +q = 1 + +[query_server_config] +; Default limit is 2^28=268435456. Override it to INTEGER.MAX to be in sync with CouchDB 1.x +query_limit = 2147483646 + +[log] +level = info +writer = file +file = /data/log/couchdb3.log + +[admins] +admin = admin diff --git a/3.4.3-alpine-clouseau/resources/10-docker-default.ini b/3.4.3-alpine-clouseau/resources/10-docker-default.ini new file mode 100644 index 0000000..1aa633c --- /dev/null +++ b/3.4.3-alpine-clouseau/resources/10-docker-default.ini @@ -0,0 +1,8 @@ +; CouchDB Configuration Settings + +; Custom settings should be made in this file. They will override settings +; in default.ini, but unlike changes made to default.ini, this file won't be +; overwritten on server upgrade. + +[chttpd] +bind_address = any diff --git a/3.4.3-alpine-clouseau/resources/clouseau/clouseau.ini b/3.4.3-alpine-clouseau/resources/clouseau/clouseau.ini new file mode 100644 index 0000000..a223366 --- /dev/null +++ b/3.4.3-alpine-clouseau/resources/clouseau/clouseau.ini @@ -0,0 +1,4 @@ +[clouseau] +name=clouseau@127.0.0.1 +dir=/data/couchdb/search_indexes +max_indexes_open=500 diff --git a/3.4.3-alpine-clouseau/resources/clouseau/clouseau.sh b/3.4.3-alpine-clouseau/resources/clouseau/clouseau.sh new file mode 100644 index 0000000..2c23261 --- /dev/null +++ b/3.4.3-alpine-clouseau/resources/clouseau/clouseau.sh @@ -0,0 +1,12 @@ +# chmod 0600 /opt/couchdb-search/etc/jmxremote.password + +exec -c "java -server \ + -Xmx2G \ + -Dsun.net.inetaddr.ttl=30 \ + -Dsun.net.inetaddr.negative.ttl=30 \∂ + -XX:OnOutOfMemoryError="kill -9 %p" \ + -XX:+UseConcMarkSweepGC \ + -XX:+CMSParallelRemarkEnabled \ + -classpath '/opt/couchdb-search/lib/*' \ + com.cloudant.clouseau.Main \ + /opt/couchdb-search/etc/clouseau.ini" diff --git a/3.4.3-alpine-clouseau/resources/clouseau/simplelogger.properties b/3.4.3-alpine-clouseau/resources/clouseau/simplelogger.properties new file mode 100644 index 0000000..9d234e9 --- /dev/null +++ b/3.4.3-alpine-clouseau/resources/clouseau/simplelogger.properties @@ -0,0 +1,34 @@ +# SLF4J's SimpleLogger configuration file +# Simple implementation of Logger that sends all enabled log messages, for all defined loggers, to System.err. + +# Default logging detail level for all instances of SimpleLogger. +# Must be one of ("trace", "debug", "info", "warn", or "error"). +# If not specified, defaults to "info". +org.slf4j.simpleLogger.defaultLogLevel=trace + +# Logging detail level for a SimpleLogger instance named "xxxxx". +# Must be one of ("trace", "debug", "info", "warn", or "error"). +# If not specified, the default logging detail level is used. +#org.slf4j.simpleLogger.log.xxxxx= + +# Set to true if you want the current date and time to be included in output messages. +# Default is false, and will output the number of milliseconds elapsed since startup. +org.slf4j.simpleLogger.showDateTime=true + +# The date and time format to be used in the output messages. +# The pattern describing the date and time format is the same that is used in java.text.SimpleDateFormat. +# If the format is not specified or is invalid, the default format is used. +# The default format is yyyy-MM-dd HH:mm:ss:SSS Z. +#org.slf4j.simpleLogger.dateTimeFormat=yyyy-MM-dd HH:mm:ss:SSS Z + +# Set to true if you want to output the current thread name. +# Defaults to true. +#org.slf4j.simpleLogger.showThreadName=true + +# Set to true if you want the Logger instance name to be included in output messages. +# Defaults to true. +#org.slf4j.simpleLogger.showLogName=true + +# Set to true if you want the last component of the name to be included in output messages. +# Defaults to false. +#org.slf4j.simpleLogger.showShortLogName=false diff --git a/3.4.3-alpine-clouseau/resources/pre_stop b/3.4.3-alpine-clouseau/resources/pre_stop new file mode 100644 index 0000000..2fbd60a --- /dev/null +++ b/3.4.3-alpine-clouseau/resources/pre_stop @@ -0,0 +1,30 @@ +#!/bin/bash + +if [ -z "$1" ]; then + terminationPeriod=300 +else + terminationPeriod=$1 +fi + +timeToSleep=5 +numIterations=$(awk -v var1=$terminationPeriod -v var2=$timeToSleep 'BEGIN { print ( var1 / var2 ) }') + +# Mark each runsv service as down, which will send each process a TERM +for file in /conf/service/*/supervise/control; do + echo "d" > $file; +done + +# Allow the processes time to terminate gracefully +i="0" +while [ $i -lt $numIterations ]; do + numServices=$(find /conf/service/* -maxdepth 0 -type d | wc -l) + numDownServices=$(grep -r "^down$" /conf/service/*/supervise/stat | wc -l) + if [ $numServices -ne $numDownServices ]; then + sleep $timeToSleep + i=$[$i+1] + else + exit 0 + fi +done + +exit 1 diff --git a/3.4.3-alpine-clouseau/resources/run b/3.4.3-alpine-clouseau/resources/run new file mode 100644 index 0000000..7d1d6b8 --- /dev/null +++ b/3.4.3-alpine-clouseau/resources/run @@ -0,0 +1 @@ +# populated in dockerfile entrypoint so that ERL_FLAGS are propagated diff --git a/3.4.3-alpine-clouseau/resources/run_clouseau b/3.4.3-alpine-clouseau/resources/run_clouseau new file mode 100644 index 0000000..9c18b33 --- /dev/null +++ b/3.4.3-alpine-clouseau/resources/run_clouseau @@ -0,0 +1 @@ +# populated in dockerfile entrypoint diff --git a/3.4.3-alpine-clouseau/resources/vm.args b/3.4.3-alpine-clouseau/resources/vm.args new file mode 100644 index 0000000..aeee1e4 --- /dev/null +++ b/3.4.3-alpine-clouseau/resources/vm.args @@ -0,0 +1,47 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +# Ensure that the Erlang VM listens on a known port +-kernel inet_dist_listen_min 9100 +-kernel inet_dist_listen_max 9100 + +# Tell kernel and SASL not to log anything +-kernel error_logger silent +-sasl sasl_error_logger false + +# This will toggle to true in Erlang 25+. However since we don't use global +# any longer, and have our own auto-connection module, we can keep the +# existing global behavior to avoid surprises. See +# https://github.com/erlang/otp/issues/6470#issuecomment-1337421210 for more +# information about possible increased coordination and messages being sent on +# disconnections when this setting is enabled. +# +-kernel prevent_overlapping_partitions false + +# Increase the pool of dirty IO schedulers from 10 to 16 +# Dirty IO schedulers are used for file IO. ++SDio 16 + +# Increase distribution buffer size from default of 1MB to 32MB. The default is +# usually a bit low on busy clusters. Has no effect for single-node setups. +# The unit is in kilobytes. ++zdbbl 32768 + +# When running on Docker, Kubernetes or an OS using CFS (Completely Fair +# Scheduler) with CPU quota limits set, disable busy waiting for schedulers to +# avoid busy waiting consuming too much of Erlang VM's CPU time-slice shares. ++sbwt none ++sbwtdcpu none ++sbwtdio none + +# Comment this line out to enable the interactive Erlang shell on startup ++Bd -noinput