From a994128f4c0ed81cba12279a80006a7d9b5cc41c Mon Sep 17 00:00:00 2001 From: Rosiney Gomes Pereira Date: Thu, 14 Jan 2021 09:54:48 -0300 Subject: [PATCH] feat: option to pull image before start mkdkr job --- .mkdkr | 17 +++++++++++++++++ README.md | 21 +++++++++++---------- 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/.mkdkr b/.mkdkr index ea1e329..383dc26 100755 --- a/.mkdkr +++ b/.mkdkr @@ -211,6 +211,18 @@ _update_workdir() { _MKDKR_WORKDIR=$(docker inspect --format='{{.Config.WorkingDir}}' "${container_name}") } +_docker_image_pull() { + local -r image="${1}" + if [ "${MKDKR_DOCKER_IMAGE_PULL:-missing}" == "always" ]; then + _pretty "orange" "\ndocker pull image: ${image}" + docker pull "${image}" >&2 + local -r exit_code="$?" + if [ "$exit_code" != "0" ]; then + exit "$exit_code" + fi + fi +} + # header fn _header_render() { cat < - to overwrite the values use: `export =` > - \* auto generated