Commit 57dabdf4 authored by Adrian DC's avatar Adrian DC
Browse files

feat: implement #38: pull Docker images if missing upon execution

parent 6f13d7fa
Loading
Loading
Loading
Loading
Loading
+7 −0
Changes for gitlabci_local/runner.py: 7 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@ import tempfile

# Components
from .main import NAME, term
from .puller import pull

# Launcher
def launcher(options, jobs):
@@ -152,6 +153,12 @@ def runner(options, job_data, last_result):
    # Container execution
    if image not in ['local']:

        # Image validation
        try:
            client.images.get(image)
        except docker.errors.ImageNotFound:
            pull(image)

        # Launch container
        container = client.containers.run(
            image, command=scriptFile.name, detach=True, entrypoint=entrypoint,