@@ -221,6 +221,18 @@ class BuildCommand(SubCommand):
# Create a docker context directory for the build
docker_dir = tempfile.mkdtemp(prefix="docker_build")
+ # Is there a .pre file to run in the build context?
+ docker_pre = os.path.splitext(args.dockerfile)[0]+".pre"
+ if os.path.exists(docker_pre):
+ rc = subprocess.call(os.path.realpath(docker_pre),
+ cwd=docker_dir)
+ if rc == 3:
+ print "Skip"
+ return 0
+ elif rc != 0:
+ print "%s exited with code %d" % (docker_pre, rc)
+ return 1
+
# Do we include a extra binary?
if args.include_executable:
_copy_binary_with_libs(args.include_executable,