kopia lustrzana https://github.com/jupyterhub/repo2docker
Remove docker-pull hack
No longer check if image exists by doing a docker-pull - binderhub will no longer start a build if it knows that the image already existspull/26/head
rodzic
2a092c974d
commit
51c5f72b45
|
@ -251,25 +251,14 @@ class Repo2Docker(Application):
|
||||||
s.close()
|
s.close()
|
||||||
return port
|
return port
|
||||||
|
|
||||||
def image_exists(self):
|
|
||||||
client = docker.from_env(version='auto')
|
|
||||||
# HACK: Try to just pull this and see if that works.
|
|
||||||
# if it does, then just bail.
|
|
||||||
# WHAT WE REALLY WANT IS TO NOT DO ANY WORK IF THE IMAGE EXISTS
|
|
||||||
try:
|
|
||||||
image = client.images.pull(self.output_image_spec)
|
|
||||||
return True
|
|
||||||
except docker.errors.ImageNotFound:
|
|
||||||
return False
|
|
||||||
|
|
||||||
def start(self):
|
def start(self):
|
||||||
if not self.image_exists():
|
|
||||||
checkout_path = os.path.join(self.git_workdir, str(uuid.uuid4()))
|
checkout_path = os.path.join(self.git_workdir, str(uuid.uuid4()))
|
||||||
self.fetch(
|
self.fetch(
|
||||||
self.repo,
|
self.repo,
|
||||||
self.ref,
|
self.ref,
|
||||||
checkout_path
|
checkout_path
|
||||||
)
|
)
|
||||||
|
|
||||||
for bp_class in self.buildpacks:
|
for bp_class in self.buildpacks:
|
||||||
bp = bp_class(parent=self, log=self.log, capture=self.json_logs)
|
bp = bp_class(parent=self, log=self.log, capture=self.json_logs)
|
||||||
if bp.detect(checkout_path):
|
if bp.detect(checkout_path):
|
||||||
|
@ -288,6 +277,3 @@ class Repo2Docker(Application):
|
||||||
|
|
||||||
if self.run:
|
if self.run:
|
||||||
self.run_image()
|
self.run_image()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue