@@ -42,6 +42,7 @@ export class GenericContainerBuilder {
4242
4343 constructor (
4444 private readonly context : BuildContext ,
45+ private readonly dockerfileName : string ,
4546 private readonly uuid : Uuid = new RandomUuid ( ) ,
4647 private readonly dockerClientFactory : DockerClientFactory = new DockerodeClientFactory ( )
4748 ) { }
@@ -57,7 +58,7 @@ export class GenericContainerBuilder {
5758
5859 const repoTag = new RepoTag ( image , tag ) ;
5960 const dockerClient = this . dockerClientFactory . getClient ( ) ;
60- await dockerClient . buildImage ( repoTag , this . context , this . buildArgs ) ;
61+ await dockerClient . buildImage ( repoTag , this . context , this . dockerfileName , this . buildArgs ) ;
6162 const container = new GenericContainer ( image , tag , this . dockerClientFactory ) ;
6263
6364 if ( ! ( await container . isImageCached ( ) ) ) {
@@ -69,8 +70,8 @@ export class GenericContainerBuilder {
6970}
7071
7172export class GenericContainer implements TestContainer {
72- public static fromDockerfile ( context : BuildContext ) : GenericContainerBuilder {
73- return new GenericContainerBuilder ( context ) ;
73+ public static fromDockerfile ( context : BuildContext , dockerfileName : string = "Dockerfile" ) : GenericContainerBuilder {
74+ return new GenericContainerBuilder ( context , dockerfileName ) ;
7475 }
7576
7677 private readonly repoTag : RepoTag ;
0 commit comments