Fix an issue that %%docker doesn't work. (#119)

This commit is contained in:
qimingj 2018-11-06 20:06:58 -08:00 committed by k8s-ci-robot
parent 849c8cfe77
commit bb62b321a5
1 changed files with 6 additions and 4 deletions

View File

@ -21,6 +21,7 @@ except ImportError:
from kfp.compiler import build_docker_image
import os
import tempfile
@ -35,8 +36,9 @@ def docker(line, cell):
target, staging = line.split()
with tempfile.NamedTemporaryFile(mode='wt') as f:
f.write(cell)
build_docker_image(staging, target, f.name)
with tempfile.NamedTemporaryFile(mode='wt', delete=False) as f:
f.write(cell)
build_docker_image(staging, target, f.name)
os.remove(f.name)