Skip to content

Commit 97b01bd

Browse files
committed
add fix for mosquitto higher than 2.1.1
1 parent a1d0c9c commit 97b01bd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

modules/mqtt/testcontainers/mqtt/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ def start(self, configfile: Optional[str] = None) -> Self:
121121
# default config file
122122
configfile = Path(__file__).parent / MosquittoContainer.CONFIG_FILE
123123
self.with_volume_mapping(configfile, "/mosquitto/config/mosquitto.conf")
124+
# since version 2.1.1 - 2026-02-04, which fixed a PUID/PGID issue, the container needs to write to the data directory,
125+
# so we need to map it to a volume
126+
self.with_volume_mapping("mosquitto_data", "/data", mode="rw")
127+
124128
# if self.password:
125129
# # TODO: add authentication
126130
# pass

0 commit comments

Comments
 (0)