@@ -275,7 +275,7 @@ def attach_socket(self, container, params=None, ws=False):
275
275
def build (self , path = None , tag = None , quiet = False , fileobj = None ,
276
276
nocache = False , rm = False , stream = False , timeout = None ,
277
277
custom_context = False , encoding = None , pull = True ,
278
- forcerm = False ):
278
+ forcerm = False , dockerfile = None ):
279
279
remote = context = headers = None
280
280
if path is None and fileobj is None :
281
281
raise TypeError ("Either path or fileobj needs to be provided." )
@@ -302,6 +302,11 @@ def build(self, path=None, tag=None, quiet=False, fileobj=None,
302
302
if utils .compare_version ('1.8' , self ._version ) >= 0 :
303
303
stream = True
304
304
305
+ if dockerfile and utils .compare_version ('1.17' , self ._version ) < 0 :
306
+ raise errors .InvalidVersion (
307
+ 'dockerfile was only introduced in API version 1.17'
308
+ )
309
+
305
310
u = self ._url ('/build' )
306
311
params = {
307
312
't' : tag ,
@@ -310,7 +315,8 @@ def build(self, path=None, tag=None, quiet=False, fileobj=None,
310
315
'nocache' : nocache ,
311
316
'rm' : rm ,
312
317
'forcerm' : forcerm ,
313
- 'pull' : pull
318
+ 'pull' : pull ,
319
+ 'dockerfile' : dockerfile
314
320
}
315
321
316
322
if context is not None :
0 commit comments