diff options
| author | mo khan <mo.khan@gmail.com> | 2020-07-02 17:13:56 -0600 |
|---|---|---|
| committer | mo khan <mo.khan@gmail.com> | 2020-07-02 17:13:56 -0600 |
| commit | fc060f9f97972d92a9b62f35f189d7c12cf5ad28 (patch) | |
| tree | 4620bd8cebd0dfaac8cbefd2d88f0cd94afdd502 /bin | |
| parent | 11c7187a0b9c290437d90af2d53b4d06ae8f4232 (diff) | |
Speed up local docker-build
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/docker-build | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/bin/docker-build b/bin/docker-build index 2cd819f..ba694f1 100755 --- a/bin/docker-build +++ b/bin/docker-build @@ -4,9 +4,12 @@ set -e cd "$(dirname "$0")/.." +LATEST_IMAGE=${LATEST_IMAGE:='registry.gitlab.com/gitlab-org/security-products/license-management:latest'} +IMAGE_NAME=${IMAGE_NAME:-$(basename "$PWD"):latest} + if command -v docker; then - IMAGE_NAME=${IMAGE_NAME:-$(basename "$PWD"):latest} - docker build --network=host -t "$IMAGE_NAME" . + docker pull $LATEST_IMAGE + docker build --network=host --cache-from "$LATEST_IMAGE" -t "$IMAGE_NAME" . else echo "Install docker: https://docs.docker.com/engine/installation/" exit 1 |
