@@ -11,6 +11,7 @@ import (
1111
1212 "github.com/docker/docker/api/types/container"
1313 "github.com/docker/go-connections/nat"
14+ "github.com/docker/go-units"
1415
1516 "github.com/testcontainers/testcontainers-go"
1617 "github.com/testcontainers/testcontainers-go/wait"
@@ -26,6 +27,15 @@ type Container struct {
2627}
2728
2829// Run starts a Solace container with the provided image and options
30+ //
31+ // The container requires specific ulimits to start successfully:
32+ // - nofile: 1048576 (number of open files)
33+ // - core: -1 (for core dumps)
34+ // - memlock: -1 (for memory locking)
35+ //
36+ // See https://docs.solace.com for more information.
37+ // - https://docs.solace.com/Software-Broker/Managing-Core-Files.htm
38+ // - https://docs.solace.com/Software-Broker/Container-Tasks/Config-Container-Storage.htm?Highlight=ulimit
2939func Run (ctx context.Context , img string , opts ... testcontainers.ContainerCustomizer ) (* Container , error ) {
3040 // Override default options with provided ones
3141 settings := defaultOptions ()
@@ -57,6 +67,24 @@ func Run(ctx context.Context, img string, opts ...testcontainers.ContainerCustom
5767 testcontainers .WithExposedPorts (exposedPorts ... ),
5868 testcontainers .WithHostConfigModifier (func (hc * container.HostConfig ) {
5969 hc .ShmSize = settings .shmSize
70+ // Where disk space permits, Solace docs recommends the core file size "rlimit" for event brokers to be "unlimited".
71+ hc .Ulimits = []* units.Ulimit {
72+ {
73+ Name : "nofile" ,
74+ Soft : 1048576 ,
75+ Hard : 1048576 ,
76+ },
77+ {
78+ Name : "core" ,
79+ Soft : - 1 ,
80+ Hard : - 1 ,
81+ },
82+ {
83+ Name : "memlock" ,
84+ Soft : - 1 ,
85+ Hard : - 1 ,
86+ },
87+ }
6088 }),
6189 testcontainers .WithWaitStrategy (waitStrategies ... ),
6290 }
0 commit comments