FROM registry.access.redhat.com/ubi8/ubi-minimal
ARG RELEASE
ARG BUILD_DATE
LABEL maintainer="CouchDB Developers dev@couchdb.apache.org" \
name="Apache CouchDB" \
version="2.3.1" \
summary="Apache CouchDB based on Red Hat UBI" \
description="Red Hat OpenShift-compatible container that runs Apache CouchDB" \
release=${RELEASE} \
usage="https://github.com/apache/couchdb-docker" \
build-date=${BUILD_DATE} \
io.k8s.display-name="Apache CouchDB" \
io.k8s.description="Red Hat OpenShift-compatible container that runs Apache CouchDB" \
io.openshift.tags="database couchdb apache rhel8" \
io.openshift.expose-services="5984/http,4369/epmd,9100/erlang" \
io.openshift.min-memory="1Gi" \
io.openshift.min-cpu="1"
COPY imeyer_runit.repo /etc/yum.repos.d/imeyer_runit.repo
COPY bintray-apache-couchdb-rpm.repo /etc/yum.repos.d/bintray-apache-couchdb-rpm.repo
ENV COUCHDB_VERSION 2.3.1
RUN set -ex; \
microdnf update --disableplugin=subscription-manager -y && rm -rf /var/cache/yum; \
microdnf install -y \
ca-certificates \
gnupg \
findutils \
shadow-utils; \
useradd -u 5984 -d /opt/couchdb -g root couchdb; \
groupadd -g 5984 couchdb; \
microdnf update --disableplugin=subscription-manager -y && rm -rf /var/cache/yum; \
microdnf install --enablerepo=imeyer_runit -y runit; \
microdnf clean all; \
rm -rf /var/cache/yum
RUN set -xe; \
microdnf update --disableplugin=subscription-manager -y && rm -rf /var/cache/yum; \
microdnf install --enablerepo=bintray-apache-couchdb-rpm -y couchdb-2.3.1; \
microdnf clean all; \
rm -rf /var/cache/yum; \
rm /opt/couchdb/etc/default.d/10-filelog.ini; \
find /opt/couchdb \! \( -user couchdb -group 0 \) -exec chown -f couchdb:0 '{}' +; \
find /opt/couchdb/etc -type d ! -perm 0775 -exec chmod -f 0775 '{}' +; \
find /opt/couchdb/etc -type f ! -perm 0664 -exec chmod -f 0664 '{}' +; \
chmod 777 /opt/couchdb/data
COPY licenses /licenses
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 resources/docker-entrypoint.sh /usr/local/bin
COPY resources/run /etc/service/couchdb/
RUN chmod -R 777 /etc/service/couchdb; \
chmod 777 /usr/local/bin/docker-entrypoint.sh; \
ln -s usr/local/bin/docker-entrypoint.sh /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]
VOLUME /opt/couchdb/data
EXPOSE 5984 4369 9100
CMD ["/opt/couchdb/bin/couchdb"]