Trilokkumar1 commented on issue #282: URL: https://github.com/apache/couchdb-docker/issues/282#issuecomment-3196958140
Here is the Dockerfile ``` `FROM debian:trixie-slim ARG COUCHDB_VERSION=3.4.3 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 d...@couchdb.apache.org" # Add CouchDB user account RUN groupadd -g 5984 -r couchdb && useradd -u 5984 -d /opt/couchdb -g couchdb couchdb # Install system and build dependencies + pyenv/Rust build deps + ICU and C++ dev tools RUN apt-get update && apt-get install -y --no-install-recommends \ autoconf libtool pkg-config yasm zlib1g-dev libreadline-dev libffi-dev libssl-dev \ git wget unzip maven runit locales curl clang llvm build-essential ca-certificates \ dirmngr gnupg tini \ make build-essential libbz2-dev libsqlite3-dev libncursesw5-dev xz-utils tk-dev \ libxml2-dev libxmlsec1-dev liblzma-dev python3-venv sudo \ libicu-dev clang g++ libc++-dev # Set locale RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen ENV LANG=en_US.UTF-8 ENV LANGUAGE=en_US:en ENV LC_ALL=en_US.UTF-8 # Install pyenv and build Python 3.11.9 ENV PYENV_ROOT="/root/.pyenv" ENV PATH="$PYENV_ROOT/bin:$PATH" RUN git clone https://github.com/pyenv/pyenv.git $PYENV_ROOT \ && git clone https://github.com/pyenv/pyenv-virtualenv.git $PYENV_ROOT/plugins/pyenv-virtualenv \ && $PYENV_ROOT/bin/pyenv install 3.11.9 \ && $PYENV_ROOT/bin/pyenv global 3.11.9 \ && $PYENV_ROOT/shims/pip install --upgrade pip setuptools six ENV PATH="$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH" # Install Rust (rustc/cargo) for SpiderMonkey RUN curl https://sh.rustup.rs -sSf | bash -s -- -y ENV PATH="/root/.cargo/bin:$PATH" # Install autoconf 2.13 for SpiderMonkey WORKDIR /tmp RUN wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.13.tar.gz \ && tar xf autoconf-2.13.tar.gz \ && cd autoconf-2.13 \ && ./configure && make && make install \ && cd .. && rm -rf autoconf-2.13 autoconf-2.13.tar.gz # Download and prepare SpiderMonkey ESR91 WORKDIR /tmp RUN wget https://archive.mozilla.org/pub/firefox/releases/91.13.0esr/source/firefox-91.13.0esr.source.tar.xz \ && tar xf firefox-91.13.0esr.source.tar.xz \ && dir=$(find . -maxdepth 1 -mindepth 1 -type d -name 'firefox*' | head -n 1) \ && if [ -z "$dir" ]; then echo "Source directory not found after extraction!"; exit 1; fi \ && mv "$dir" js91 # Patch Python 'rU' mode for Python 3.11+ RUN find /tmp/js91/python/mozbuild -type f -name "*.py" -exec sed -i 's/"rU"/"r"/g' {} + RUN find /tmp/js91/python/mozbuild -type f -name "*.py" -exec sed -i "s/'rU'/'r'/g" {} + # Remove unsupported '-fexperimental-new-pass-manager' flag for Clang RUN find /tmp/js91 -type f -exec sed -i 's/-fexperimental-new-pass-manager//g' {} + # Build SpiderMonkey using Python 3.11 from pyenv WORKDIR /tmp/js91/js/src RUN autoconf RUN mkdir build-release && cd build-release && \ PYTHON=/root/.pyenv/versions/3.11.9/bin/python3 ../configure --prefix=/usr/local --disable-debug --disable-jemalloc --enable-readline && \ make -j$(nproc) && \ make install # Clean up SpiderMonkey source WORKDIR / RUN rm -rf /tmp/js91 /tmp/firefox-91.13.0esr.source.tar.xz # Install Temurin 8 JDK via tarball (specific version, as of 8u412) RUN mkdir -p /opt/java && \ wget -qO- "https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u412-b08/OpenJDK8U-jdk_x64_linux_hotspot_8u412b08.tar.gz" \ | tar xz --strip-components=1 -C /opt/java && \ ln -sf /opt/java/bin/java /usr/bin/java && \ ln -sf /opt/java/bin/javac /usr/bin/javac ENV JAVA_HOME=/opt/java ENV PATH="$JAVA_HOME/bin:$PATH" # Fetch and extract Clouseau RUN 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 && \ rm -rf /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 # Build CouchDB from source WORKDIR /usr/src RUN git clone --branch ${COUCHDB_VERSION} --depth 1 https://github.com/apache/couchdb.git couchdb-src WORKDIR /usr/src/couchdb-src RUN ./configure && make release && cp -a rel/couchdb /opt/ && rm -rf /usr/src/couchdb-src # Set permissions on CouchDB directories RUN chown -R couchdb:couchdb /opt/couchdb # Copy config files and set permissions 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 licenses COPY licenses /licenses # Add configuration files 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 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 EXPOSE 5984 4369 9100 CMD ["/opt/couchdb/bin/couchdb"] ` ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@couchdb.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org