From b449344f789e66fc104591622b427c37d63a411e Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 13 Feb 2014 14:39:54 -0800 Subject: [PATCH] build.sh: Add BUILD_OPTS for custom build options For example, to rebuild a package without using the cache: $ REPOS=docker-registry BUILD_OPTS=--no-cache ./build.sh which lets you update your image after the upstream repository has changed. --- build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 148c30d..2926e7d 100755 --- a/build.sh +++ b/build.sh @@ -38,6 +38,7 @@ PORTAGE_SIG="${PORTAGE_SIG:-${PORTAGE}.gpgsig}" DOCKER_IO=$(command -v docker.io) DOCKER="${DOCKER:-${DOCKER_IO:-docker}}" +BUILD_OPTS="${BUILD_OPTS:-}" REPOS="${REPOS:- portage @@ -203,7 +204,7 @@ build_repo() < "${REPO}/Dockerfile.template" > "${REPO}/Dockerfile" msg "build ${NAMESPACE}/${REPO}:${DATE}" - "${DOCKER}" build -t "${NAMESPACE}/${REPO}:${DATE}" "${REPO}" || die "failed to build" + "${DOCKER}" build ${BUILD_OPTS} -t "${NAMESPACE}/${REPO}:${DATE}" "${REPO}" || die "failed to build" fi msg "tag ${NAMESPACE}/${REPO}:latest" "${DOCKER}" tag -f "${NAMESPACE}/${REPO}:${DATE}" "${NAMESPACE}/${REPO}:latest" || die "failed to tag" -- 2.26.2