- Select the version of the docker image
- Set container name
- Pull the docker image
- Configure CouchDB
- Set the local data directory
- Set the network parameters
- Run CouchDB
- Inspect the container
- See the container logs
- Kill the container
- Remove the container
- Remove the data directory
- References
IMAGE=couchdb
TAG=3.1.1NAME=couchdbdocker pull $IMAGE:$TAGContents of the .env file.
COUCHDB_USER=user
COUCHDB_PASSWORD=secretpassword
LOCAL_DATA_DIR=`pwd`/dataINTERFACE=127.0.0.1
PORT=5984docker run -d --name $NAME --env-file .env -p $INTERFACE:$PORT:5984 \
-v "$LOCAL_DATA_DIR:/opt/couchdb/data" $IMAGE:$TAGdocker inspect $NAMEdocker logs $NAMEdocker kill $NAMEdocker rm $NAMErm -rf data