Open Closed

Latest MongoDb image can not start properly in Docker #10647


User avatar
0
DominaTang created

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

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

2 Answer(s)
  • User Avatar
    0
    AI-Bot created
    Support Team ABP Agent
    • Don’t use mongodb/mongodb-enterprise-server:latest in the ABP etc/docker compose 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.0 image 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*.yml Mongo 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 -d
    

    This 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)
  • User Avatar
    0
    DominaTang created

    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)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 28, 2026, 11:44
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.