-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
Description
Module
Core
Testcontainers version
1.18.3
Using the latest Testcontainers version?
Yes
Host OS
Windows
Host Arch
x64
Docker version
Docker version 24.0.6, build ed223bcWhat happened?
In my docker desktop I execute this command successfully:
LDB_MODULES_PATH=/usr/lib/samba/ldb/ ldbmodify -H /var/lib/samba/private/sam.ldb /tmp/test.ldif
Modified 0 records successfully
I want to do the same in testcontainers:
SAMBA_IMAGE = "instantlinux/samba-dc:4.18.5-r0"
val sambaContainer = GenericContainer(SAMBA_IMAGE)
....
sambaContainer.execInContainer(
"LDB_MODULES_PATH=/usr/lib/samba/ldb/",
"ldbmodify",
"-H",
"/var/lib/samba/private/sam.ldb",
"/tmp/test.ldif",
)
But I get the error:
OCI runtime exec failed: exec failed: unable to start container process: exec: "LDB_MODULES_PATH=/usr/lib/samba/ldb/": stat LDB_MODULES_PATH=/usr/lib/samba/ldb/: no such file or directory: unknown
I've found the workaround:
val sambaContainer = GenericContainer(SAMBA_IMAGE)
...
.withEnv("LDB_MODULES_PATH","/usr/lib/samba/ldb/")
sambaContainer.start()
sambaContainer.execInContainer(
"ldbmodify",
"-H",
"/var/lib/samba/private/sam.ldb",
"/tmp/test.ldif",
)
But I still think that my initial attempt should work.
Relevant log output
No response
Additional Information
No response