- 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.1
NAME=couchdb
docker pull $IMAGE:$TAG
Contents of the .env file.
COUCHDB_USER=user
COUCHDB_PASSWORD=secretpassword
LOCAL_DATA_DIR=`pwd`/data
INTERFACE=127.0.0.1
PORT=5984
docker run -d --name $NAME --env-file .env -p $INTERFACE:$PORT:5984 \
-v "$LOCAL_DATA_DIR:/opt/couchdb/data" $IMAGE:$TAG
docker inspect $NAME
docker logs $NAME
docker kill $NAME
docker rm $NAME
rm -rf data