Replies: 1 comment
-
Hi,
I'd say is using Another approach is running an empty database and then populate it with one of the approaches mentioned above and then commit the image. So, next time you can use the new image instead. See this code snippet
Do you really want to test restarts or want to test network failures? If so, then you can use Toxiproxy |
Beta Was this translation helpful? Give feedback.
-
I am trying to simulate restart behavior (there is no 'restart' testcontainer API provided, right?) and to do so, I've been trying to start up a container, stop it, then create a new container that mounts the data dir of the first container. I've tried doing so with the following approaches:
withCopyFileToContainer(MountableFile.forHostPath(<dir>)...
but that doesn't work well because on macs you can't preserve the UID if you don't have a user of that UID and unless yousudo
a bunch of commandschown
s the entire volume to the right user? it doesn't seem I can do this with docker's entrypoint + commandNone of these options really worked and mainly, I think, because my host machine doesn't have the UID of the user to whom the data directory belongs in my system.
Questions:
Beta Was this translation helpful? Give feedback.
All reactions