Skip to content

Commit d44382e

Browse files
committed
Set default Docker image for MongoDB Dev Services
1 parent 523a0e0 commit d44382e

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

docs/src/main/asciidoc/_attributes.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
:amqp-image: ${amqp.image}
2323
:apicurio-registry-image: ${apicurio-registry.image}
2424
:narayana-lra-image: ${narayana-lra.image}
25+
:mongo-image: ${mongo.image}
2526
:jandex-version: ${jandex.version}
2627
:jandex-gradle-plugin-version: ${jandex-gradle-plugin.version}
2728
:kotlin-version: ${kotlin.version}

docs/src/main/asciidoc/mongodb-dev-services.adoc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ and pull requests should be submitted there:
44
https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc
55
////
66
= Dev Services for MongoDB
7+
include::_attributes.adoc[]
78

89
Quarkus supports a feature called Dev Services that allows you to create various datasources without any config. In the case of MongoDB this support extends to the default MongoDB connection.
910
What that means practically, is that if you have not configured `quarkus.mongodb.connection-string` nor `quarkus.mongodb.hosts`, Quarkus will automatically start a MongoDB container when
@@ -35,12 +36,12 @@ You can disable the sharing with `quarkus.mongodb.devservices.shared=false`.
3536
The MongoDB Dev Services supports xref:compose-dev-services.adoc[Compose Dev Services].
3637
It relies on a `compose-devservices.yml`, such as:
3738

38-
[source,yaml]
39+
[source,yaml,subs=attributes+]
3940
----
4041
name: <application name>
4142
services:
4243
mongo:
43-
image: docker.io/mongo:7.0
44+
image: {mongo-image}
4445
ports:
4546
- "27017"
4647
----

docs/src/main/asciidoc/mongodb.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,9 +372,9 @@ startup time if the Mongo Client is inactive. Alternatively, Mongo Clients may a
372372
As by default, `MongoClient` is configured to access a local MongoDB database on port 27017 (the default MongoDB port), if you have a local running database on this port, there is nothing more to do before being able to test it!
373373

374374
If you want to use Docker to run a MongoDB database, you can use the following command to launch one:
375-
[source,bash]
375+
[source,bash,subs=attributes+]
376376
----
377-
docker run -ti --rm -p 27017:27017 mongo:4.4
377+
docker run -ti --rm -p 27017:27017 {mongo-image}
378378
----
379379

380380
[NOTE]

extensions/mongodb-client/deployment/src/main/java/io/quarkus/mongodb/deployment/DevServicesBuildTimeConfig.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import java.util.Map;
44
import java.util.Optional;
55

6+
import io.quarkus.runtime.annotations.ConfigDocDefault;
67
import io.quarkus.runtime.annotations.ConfigDocMapKey;
78
import io.quarkus.runtime.annotations.ConfigGroup;
89
import io.smallrye.config.WithDefault;
@@ -22,6 +23,7 @@ public interface DevServicesBuildTimeConfig {
2223
/**
2324
* The container image name to use, for container based DevServices providers.
2425
*/
26+
@ConfigDocDefault(value = "`{mongo-image}`", escape = false)
2527
Optional<String> imageName();
2628

2729
/**

0 commit comments

Comments
 (0)