Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FAB-5700 Couchdb crashes with mounted volume
The CouchDB image has a volume at /opt/couchdb/data which it uses to store it's persistent data. If you try to attach an external volume for this and either the host path does not exist or the permissions for the host path are incorrect, CouchDB will crash and the container will fail to start. This comes down to a permissions issue coupled with "helpful" behavior from the Docker daemon. The issue is that if the host path does not exist, the Docker daemon will create the host path but will create it under the same user as the daemon is running (which is typically root). The current Dockerfile then changes the user to couchdb but now which then runs all subsequent commands as couchdb. Although a volume is created after this, permissions are not / cannot be properly set. So this fix removes the use of the USER command in the Dockerfile, changes ownership of the volume in the docker-entrypoint script and then finally uses su-exec to start CouchDB as the couchdb user Change-Id: If8ac0e34b13d447d68b99408cebcfbf93d257c0f Signed-off-by: Gari Singh <gari.r.singh@gmail.com>
- Loading branch information