File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -30,3 +30,18 @@ Using `DockerContainer` and `DockerImage` to create a container:
3030
3131The `DockerImage ` class is used to build the image from the specified path and tag.
3232The `DockerContainer ` class is then used to create a container from the image.
33+
34+
35+ Creating a container with an exposed port and a custom environment variable:
36+
37+ .. doctest ::
38+
39+ >>> from testcontainers.core.container import DockerContainer
40+ >>> from testcontainers.core.waiting_utils import wait_for_logs
41+
42+ >>> container = DockerContainer(" stain/jena-fuseki:latest" )
43+ >>> container.with_exposed_ports(3030 )
44+ >>> container.with_env(" ADMIN_PASSWORD" , " password" )
45+ >>> container.start()
46+ >>> delay = wait_for_logs(container, " Fuseki is available" )
47+ >>> container_url = f " http:// { container.get_container_host_ip()} : { container.get_exposed_port(3030 )} "
You can’t perform that action at this time.
0 commit comments