Skip to content
This repository has been archived by the owner on Feb 12, 2019. It is now read-only.

Needed a way to map internal container UID/GID to external ones. Adde… #113

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions 1.6.1/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@
set -e

if [ "$1" = 'couchdb' ]; then
# map user UID and group GID's back to parent system
# useful for using persistent volumes and preserving id mappings
if [ "$COUCHDB_UID" ]; then
usermod -o -u $COUCHDB_UID couchdb
fi

if [ "$COUCHDB_GID" ]; then
groupmod -o -g $COUCHDB_GID couchdb
fi

# we need to set the permissions here because docker mounts volumes as root
chown -R couchdb:couchdb \
/usr/local/var/lib/couchdb \
Expand Down
10 changes: 10 additions & 0 deletions 2.0.0/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@
set -e

if [ "$1" = '/opt/couchdb/bin/couchdb' ]; then
# map user UID and group GID's back to parent system
# useful for using persistent volumes and preserving id mappings
if [ "$COUCHDB_UID" ]; then
usermod -o -u $COUCHDB_UID couchdb
fi

if [ "$COUCHDB_GID" ]; then
groupmod -o -g $COUCHDB_GID couchdb
fi

# we need to set the permissions here because docker mounts volumes as root
chown -R couchdb:couchdb /opt/couchdb

Expand Down