MongoDB on Docker

1. create the container

docker run --name mongodb --restart=always \
    -p 27017:27017 \
    -v /storage/database/mongodb:/data/db 
    -d mongo:3 \
    --storageEngine wiredTiger

2. set SELinux context

chcon -Rt svirt_sandbox_file_t /storage/database/mongodb

Leave a Reply

Your email address will not be published. Required fields are marked *