7
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-06-16 12:22:22 +00:00
tutor/tutor/images.py

22 lines
483 B
Python
Raw Normal View History

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)
2019-07-03 14:09:33 +00:00
def pull(tag):
fmt.echo_info("Pulling image {}".format(tag))
utils.execute("docker", "pull", tag)
2019-07-03 14:09:33 +00:00
def push(tag):
fmt.echo_info("Pushing image {}".format(tag))
2019-07-03 14:09:33 +00:00
utils.execute("docker", "push", tag)