7
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-06-18 05:12:21 +00:00
tutor/tutor/images.py
Régis Behmo b1c7dab03e Add support for images build --add-host
This was originally proposed here by @grinderz:
https://github.com/overhangio/tutor/pull/355
2020-09-04 12:35:44 +02:00

22 lines
483 B
Python

from . import fmt
from . import utils
def get_tag(config, name):
return config["DOCKER_IMAGE_" + name.upper().replace("-", "_")]
def build(path, tag, *args):
fmt.echo_info("Building image {}".format(tag))
utils.docker("build", "-t", tag, *args, path)
def pull(tag):
fmt.echo_info("Pulling image {}".format(tag))
utils.execute("docker", "pull", tag)
def push(tag):
fmt.echo_info("Pushing image {}".format(tag))
utils.execute("docker", "push", tag)