In the etc/docker folder, the compose file contains: mongo-db: container_name: mongodb image: mongodb/mongodb-enterprise-server:latest volumes: - mongodata:/data/db - mongoconfigdata:/data/configdb
In my local docker, the image file with 'latest' tag is actually 2 years ago, if connect it with NoSQLBooster, I can tell the image version is 7.0.14
Since I want to try MongoDb version 8, so I remove that image from docker, after run ./up.ps1, form docker, it seems the version is 8.2.7 .. however, the mongoDb instance is not started properly 
2 Answer(s)
-
0
- Don’t use
mongodb/mongodb-enterprise-server:latestin the ABPetc/dockercompose for local development if you want MongoDB 8.x. That “enterprise-server” image/tag can change behavior across major versions and may fail to start with your existing local volumes/config, especially after you previously ran a different major version. - Use the official
mongo:8.0image and (recommended for ABP features like transactions) run it as a single-node replica set. This is the setup ABP documents for a transaction-enabled MongoDB in Docker.
Update your
etc/docker/docker-compose*.ymlMongo service to something like:version: "3.8" services: mongo-db: container_name: mongodb image: mongo:8.0 command: ["--replSet", "rs0", "--bind_ip_all", "--port", "27017"] ports: - "27017:27017" volumes: - mongodata:/data/db - mongoconfigdata:/data/configdb healthcheck: test: echo "try { rs.status() } catch (err) { rs.initiate({_id:'rs0',members:[{_id:0,host:'127.0.0.1:27017'}]}) }" | mongosh --port 27017 --quiet interval: 5s timeout: 30s start_period: 0s start_interval: 1s retries: 30 volumes: mongodata: mongoconfigdata:Then reset volumes (important when switching major versions) and start again:
docker compose down -v docker compose up -dThis ensures old 7.x data files aren’t reused by 8.x in a way that prevents a clean start.
Sources:
- https://abp.io/docs/latest/framework/data/mongodb/
This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) - Don’t use
-
0
thanks, mongo:8.0 works
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)