Skip to content
This repository has been archived by the owner on Jul 30, 2021. It is now read-only.

Commit

Permalink
[FAB-12023] CouchDB image config problem
Browse files Browse the repository at this point in the history
The CouchDB docker image starts slowly due to directory permissions being applied
during container startup.

This change moves the grants and permissions to the CouchDB image creation.

This change also reverts the CouchDB version from 2.2.0 to 2.1.1

Change-Id: I081f2d238a1002a31bc18cd39277704631e69d8b
Signed-off-by: Chris Elder <[email protected]>
  • Loading branch information
Chris Elder authored and denyeart committed Oct 8, 2018
1 parent 997ecdc commit ec6800a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
9 changes: 7 additions & 2 deletions images/couchdb/Dockerfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ RUN set -xe \
done; \
done

ENV COUCHDB_VERSION 2.2.0
ENV COUCHDB_VERSION 2.1.1

# Download dev dependencies
RUN buildDeps=' \
Expand Down Expand Up @@ -126,7 +126,12 @@ COPY payload/20-fabric-default.ini /opt/couchdb/etc/default.d/
COPY payload/docker-entrypoint.sh /

# Setup directories and permissions
RUN chown -R couchdb:couchdb /opt/couchdb/etc/default.d/ /opt/couchdb/etc/vm.args
RUN chmod +x /docker-entrypoint.sh \
&& chown -R couchdb:couchdb /opt/couchdb/etc/default.d/ /opt/couchdb/etc/vm.args \
&& chmod -R 0770 /opt/couchdb/data \
&& chmod 664 /opt/couchdb/etc/*.ini \
&& chmod 664 /opt/couchdb/etc/default.d/*.ini \
&& chmod 775 /opt/couchdb/etc/*.d

WORKDIR /opt/couchdb
EXPOSE 5984 4369 9100
Expand Down
8 changes: 0 additions & 8 deletions images/couchdb/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,6 @@ if [ "$1" = 'couchdb' ]; then
fi

if [ "$1" = '/opt/couchdb/bin/couchdb' ]; then
# we need to set the permissions here because docker mounts volumes as root

This comment has been minimized.

Copy link
@glmars

glmars Mar 5, 2019

Why have you deleted this block of code? Now we have a described in comment problem with permissions of /opt/couchdb/data in 0.4.14 :(

chown -R couchdb:couchdb /opt/couchdb

chmod -R 0770 /opt/couchdb/data

chmod 664 /opt/couchdb/etc/*.ini
chmod 664 /opt/couchdb/etc/default.d/*.ini
chmod 775 /opt/couchdb/etc/*.d

if [ ! -z "$NODENAME" ] && ! grep "couchdb@" /opt/couchdb/etc/vm.args; then
echo "-name couchdb@$NODENAME" >> /opt/couchdb/etc/vm.args
Expand Down

0 comments on commit ec6800a

Please sign in to comment.