File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -141,9 +141,12 @@ fn generic_image_port_not_exposed() -> anyhow::Result<()> {
141141 let target_port = 8080 ;
142142
143143 // This image binds to 0.0.0.0:8080, does not EXPOSE ports in its dockerfile.
144- let generic_server = GenericImage :: new ( "no_expose_port" , "latest" )
145- . with_wait_for ( WaitFor :: message_on_stdout ( "listening on 0.0.0.0:8080" ) ) ;
146- let node = generic_server. start ( ) ?;
144+ let node = GenericBuildableImage :: new ( "no_expose_port" , "latest" )
145+ // "Dockerfile" is included already, so adding the build context directory is all what is needed
146+ . with_file ( std:: fs:: canonicalize ( "../testimages/no_expose_port" ) ?, "." )
147+ . build_image ( ) ?
148+ . with_wait_for ( WaitFor :: message_on_stdout ( "listening on 0.0.0.0:8080" ) )
149+ . start ( ) ?;
147150
148151 // Without exposing the port with `with_exposed_port()`, we cannot get a mapping to it.
149152 let res = node. get_host_port_ipv4 ( target_port. tcp ( ) ) ;
You can’t perform that action at this time.
0 commit comments