Skip to content

Conversation

@marcospereira
Copy link

Related to #708.

This installs mongosh on Windows images, since it is not installed by default with mongodb.

References

@tianon
Copy link
Member

tianon commented Jan 23, 2026

To be completely frank, I'm not 100% convinced we should install mongosh in the Windows images when it isn't included in upstream's standard server installers. 🤔

As for the checksums, it's neat that this is possible to implement in such clean PowerShell, but if we implement/accept this, what we'll actually need is something that splits this -- scraping the checksum in versions.sh and then embedding it in the Dockerfile directly, where we then only need to verify it. I'd actually forgotten that we have Nano Server here as well, which honestly makes the non-.msi artifacts more attractive too (because they can be a simpler COPY --from like we have for the server, but I guess we could do that with the .msi too).

Can you perhaps explain a bit more about your use case where you're needing mongosh in the Windows images? Maybe what you're actually using the Windows container images for in general?

@marcospereira
Copy link
Author

Can you perhaps explain a bit more about your use case where you're needing mongosh in the Windows images? Maybe what you're actually using the Windows container images for in general?

I'm mainly using the Windows version for local dev, tests, and CI. The way I do it is by starting the containers using Docker Compose, and then having a healthcheck like this:

services:

  mongodb:
    image: mongo:8
    container_name: mongodb
    hostname: mongodb
    environment:
      MONGO_INITDB_ROOT_USERNAME: ${DATABASE_USERNAME}
      MONGO_INITDB_ROOT_PASSWORD: ${DATABASE_PASSWORD}
    ports:
      - "27017:27017"
    healthcheck:
      test: [ "CMD", "mongosh", "--eval", "'db.runCommand({ ping: 1 })'" ]
      interval: 10s
      timeout: 5s
      retries: 5

On Windows, this will fail because mongosh is not installed. Apart from the healthcheck, it is also a convenient way to run one-off commands/queries on that container. Finally, the Linux image contains mongosh, so it feels right to me that the Windows counterpart would be consistent with that.


Also, if possible, could you please approve the workflows to run so that I can see if this at least gets a green build?

@marcospereira
Copy link
Author

As for the checksums, it's neat that this is possible to implement in such clean PowerShell, but if we implement/accept this, what we'll actually need is something that splits this -- scraping the checksum in versions.sh and then embedding it in the Dockerfile directly, where we then only need to verify it.

Ah, okay, I took a look at the versions.sh, and indeed it makes sense to do it that way. It will be easier to run it later in a more reliable way, since it won't depend as much on the GH API.

If you decide it makes sense to include mongosh in the Windows image, I can try to adapt this PR to do so instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants