@@ -101,6 +101,7 @@ public class TarantoolCartridgeContainer extends GenericContainer<TarantoolCartr
101101 private static final String ENV_TARANTOOL_WORKDIR = "TARANTOOL_WORKDIR" ;
102102 private static final String ENV_TARANTOOL_RUNDIR = "TARANTOOL_RUNDIR" ;
103103 private static final String ENV_TARANTOOL_DATADIR = "TARANTOOL_DATADIR" ;
104+ private static final String ENV_TARANTOOL_INSTANCES_FILE = "TARANTOOL_INSTANCES_FILE" ;
104105 private boolean useFixedPorts = false ;
105106
106107 private String routerHost = ROUTER_HOST ;
@@ -125,6 +126,20 @@ public TarantoolCartridgeContainer(String instancesFile, String topologyConfigur
125126 this (DOCKERFILE , instancesFile , topologyConfigurationFile );
126127 }
127128
129+ /**
130+ * Create a container with default image and specified instances file from the classpath resources. Assumes that
131+ * there is a file named Dockerfile in the project resources classpath.
132+ *
133+ * @param instancesFile path to instances.yml, relative to the classpath resources
134+ * @param topologyConfigurationFile path to a topology bootstrap script, relative to the classpath resources
135+ * @param buildArgs a map of arguments that will be passed to docker ARG commands on image build.
136+ * This values can be overridden by environment.
137+ */
138+ public TarantoolCartridgeContainer (String instancesFile , String topologyConfigurationFile ,
139+ Map <String , String > buildArgs ) {
140+ this (DOCKERFILE , "" , instancesFile , topologyConfigurationFile , buildArgs );
141+ }
142+
128143 /**
129144 * Create a container with default image and specified instances file from the classpath resources
130145 *
@@ -163,11 +178,11 @@ public TarantoolCartridgeContainer(String dockerFile, String buildImageName,
163178 * @param instancesFile URL resource path to instances.yml relative in the classpath
164179 * @param topologyConfigurationFile URL resource path to a topology bootstrap script in the classpath
165180 * @param buildArgs a map of arguments that will be passed to docker ARG commands on image build.
166- * This values can be overriden by environment.
181+ * This values can be overridden by environment.
167182 */
168183 public TarantoolCartridgeContainer (String dockerFile , String buildImageName , String instancesFile ,
169184 String topologyConfigurationFile , final Map <String , String > buildArgs ) {
170- this (withArguments (buildImage (dockerFile , buildImageName ), buildArgs ),
185+ this (withArguments (buildImage (dockerFile , buildImageName ), instancesFile , buildArgs ),
171186 instancesFile , topologyConfigurationFile );
172187 }
173188
@@ -181,10 +196,12 @@ private TarantoolCartridgeContainer(Future<String> image, String instancesFile,
181196 this .clientHelper = new TarantoolContainerClientHelper (this );
182197 }
183198
184- private static Future <String > withArguments (ImageFromDockerfile image , final Map <String , String > buildArgs ) {
199+ private static Future <String > withArguments (ImageFromDockerfile image , String instancesFile ,
200+ final Map <String , String > buildArgs ) {
185201 if (!buildArgs .isEmpty ()) {
186202 image .withBuildArgs (buildArgs );
187203 }
204+
188205 for (String envVariable : Arrays .asList (
189206 ENV_TARANTOOL_VERSION ,
190207 ENV_TARANTOOL_SERVER_USER ,
@@ -193,7 +210,8 @@ private static Future<String> withArguments(ImageFromDockerfile image, final Map
193210 ENV_TARANTOOL_SERVER_GID ,
194211 ENV_TARANTOOL_WORKDIR ,
195212 ENV_TARANTOOL_RUNDIR ,
196- ENV_TARANTOOL_DATADIR
213+ ENV_TARANTOOL_DATADIR ,
214+ ENV_TARANTOOL_INSTANCES_FILE
197215 )) {
198216 String variableValue = System .getenv (envVariable );
199217 if (variableValue != null ) {
0 commit comments