testcontainers-python icon indicating copy to clipboard operation
testcontainers-python copied to clipboard

Add support for tmpfs mounts

Open gaby opened this issue 2 years ago • 4 comments

Currently we are using tmpfs mounts with testcontainers-go to speed up bootstraping databases during CI. The data folder of the database gets mounted into a tmpfs mount which speeds up since disk i/o is avoided.

We have some components using python and noticed that testcontainers-python doesnt support tmpfs mounts.

PR for testcontainers-go here: https://github.com/testcontainers/testcontainers-go/pull/131

gaby avatar Mar 08 '23 14:03 gaby

Ping @tillahoffmann

gaby avatar Mar 23 '23 02:03 gaby

Sounds useful; open to contributions. You may be able to use with_kwargs in the meantime to mount a temporary file system.

tillahoffmann avatar Apr 11 '23 14:04 tillahoffmann

To whoever is looking for how to do it with with_kwargs, here it is:

with_kwargs(
    tmpfs={"/var/lib/mysql": "rw"}
)

This sped up mysql:8.0 docker container start up by 3 to 4 for me

rparme avatar Jul 23 '24 17:07 rparme

@rparme Thank you! 💪

gaby avatar Jul 24 '24 13:07 gaby