@@ -20,18 +20,71 @@ var (
2020
2121// testcontainersConfig {
2222
23- // Config represents the configuration for Testcontainers
23+ // Config represents the configuration for Testcontainers.
24+ // User values are read from ~/.testcontainers.properties file which can be overridden
25+ // using the specified environment variables. For more information, see [Custom Configuration].
26+ //
27+ // The Ryuk prefixed fields controls the [Garbage Collector] feature, which ensures that
28+ // resources are cleaned up after the test execution.
29+ //
30+ // [Garbage Collector]: https://golang.testcontainers.org/features/garbage_collector/
31+ // [Custom Configuration]: https://golang.testcontainers.org/features/configuration/
2432type Config struct {
25- Host string `properties:"docker.host,default="`
26- TLSVerify int `properties:"docker.tls.verify,default=0"`
27- CertPath string `properties:"docker.cert.path,default="`
28- HubImageNamePrefix string `properties:"hub.image.name.prefix,default="`
29- RyukDisabled bool `properties:"ryuk.disabled,default=false"`
30- RyukPrivileged bool `properties:"ryuk.container.privileged,default=false"`
33+ // Host is the address of the Docker daemon.
34+ //
35+ // Environment variable: DOCKER_HOST
36+ Host string `properties:"docker.host,default="`
37+
38+ // TLSVerify is a flag to enable or disable TLS verification when connecting to a Docker daemon.
39+ //
40+ // Environment variable: DOCKER_TLS_VERIFY
41+ TLSVerify int `properties:"docker.tls.verify,default=0"`
42+
43+ // CertPath is the path to the directory containing the Docker certificates.
44+ // This is used when connecting to a Docker daemon over TLS.
45+ //
46+ // Environment variable: DOCKER_CERT_PATH
47+ CertPath string `properties:"docker.cert.path,default="`
48+
49+ // HubImageNamePrefix is the prefix used for the images pulled from the Docker Hub.
50+ // This is useful when running tests in environments with restricted internet access.
51+ //
52+ // Environment variable: TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX
53+ HubImageNamePrefix string `properties:"hub.image.name.prefix,default="`
54+
55+ // RyukDisabled is a flag to enable or disable the Garbage Collector.
56+ // Setting this to true will prevent testcontainers from automatically cleaning up
57+ // resources, which is particularly important in tests which timeout as they
58+ // don't run test clean up.
59+ //
60+ // Environment variable: TESTCONTAINERS_RYUK_DISABLED
61+ RyukDisabled bool `properties:"ryuk.disabled,default=false"`
62+
63+ // RyukPrivileged is a flag to enable or disable the privileged mode for the Garbage Collector container.
64+ // Setting this to true will run the Garbage Collector container in privileged mode.
65+ //
66+ // Environment variable: TESTCONTAINERS_RYUK_CONTAINER_PRIVILEGED
67+ RyukPrivileged bool `properties:"ryuk.container.privileged,default=false"`
68+
69+ // RyukReconnectionTimeout is the time to wait before attempting to reconnect to the Garbage Collector container.
70+ //
71+ // Environment variable: TESTCONTAINERS_RYUK_RECONNECTION_TIMEOUT
3172 RyukReconnectionTimeout time.Duration `properties:"ryuk.reconnection.timeout,default=10s"`
32- RyukConnectionTimeout time.Duration `properties:"ryuk.connection.timeout,default=1m"`
33- RyukVerbose bool `properties:"ryuk.verbose,default=false"`
34- TestcontainersHost string `properties:"tc.host,default="`
73+
74+ // RyukConnectionTimeout is the time to wait before timing out when connecting to the Garbage Collector container.
75+ //
76+ // Environment variable: TESTCONTAINERS_RYUK_CONNECTION_TIMEOUT
77+ RyukConnectionTimeout time.Duration `properties:"ryuk.connection.timeout,default=1m"`
78+
79+ // RyukVerbose is a flag to enable or disable verbose logging for the Garbage Collector.
80+ //
81+ // Environment variable: TESTCONTAINERS_RYUK_VERBOSE
82+ RyukVerbose bool `properties:"ryuk.verbose,default=false"`
83+
84+ // TestcontainersHost is the address of the Testcontainers host.
85+ //
86+ // Environment variable: TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE
87+ TestcontainersHost string `properties:"tc.host,default="`
3588}
3689
3790// }
0 commit comments