launch docker with kwargs_from_env

respects DOCKER_HOST, etc.
pull/2/head
Min RK 2017-05-22 10:29:48 -07:00
rodzic b5194c9165
commit 28d6573fcb
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -9,6 +9,7 @@ from pythonjsonlogger import jsonlogger
from traitlets.config import Application, LoggingConfigurable, Unicode, Dict, List from traitlets.config import Application, LoggingConfigurable, Unicode, Dict, List
from traitlets import Type from traitlets import Type
import docker import docker
from docker.utils import kwargs_from_env
import subprocess import subprocess
@ -96,7 +97,7 @@ class Builder(Application):
# HACK: Try to just pull this and see if that works. # HACK: Try to just pull this and see if that works.
# if it does, then just bail. # if it does, then just bail.
# WHAT WE REALLY WANT IS TO NOT DO ANY WORK IF THE IMAGE EXISTS # WHAT WE REALLY WANT IS TO NOT DO ANY WORK IF THE IMAGE EXISTS
client = docker.APIClient(base_url='unix://var/run/docker.sock', version='auto') client = docker.APIClient(version='auto', **kwargs_from_env())
repo, tag = self.output_image_spec.split(':') repo, tag = self.output_image_spec.split(':')
for line in client.pull( for line in client.pull(