Skip to content

Commit

Permalink
feat(build) add ability to disable Docker cache
Browse files Browse the repository at this point in the history
  • Loading branch information
saghul committed Feb 28, 2025
1 parent ffb067e commit 9b7c220
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@ ifneq (,$(wildcard ./.env))
include .env
endif

DISABLE_CACHE ?= 0
GIT_HASH ?= $(shell git rev-parse --short HEAD)
PLATFORMS ?= linux/amd64
BUILD_ARGS =

ifeq ($(DISABLE_CACHE), 1)
BUILD_ARGS := $(BUILD_ARGS) --no-cache
endif

_login:
${DOCKER_LOGIN_CMD}
Expand All @@ -13,6 +19,7 @@ build : _login
--progress plain \
--push \
--platform ${PLATFORMS} \
$(BUILD_ARGS) \
-t ${IMAGE_REGISTRY}/skynet:summaries-${GIT_HASH} \
-t ${IMAGE_REGISTRY}/skynet:whisper-${GIT_HASH} \
-t ${IMAGE_REGISTRY}/skynet:${GIT_HASH} \
Expand All @@ -23,6 +30,7 @@ build-cpu : _login
--progress plain \
--push \
--platform ${PLATFORMS} \
$(BUILD_ARGS) \
--build-arg BASE_IMAGE_BUILD=ubuntu:22.04 \
--build-arg BASE_IMAGE_RUN=ubuntu:22.04 \
--build-arg BUILD_WITH_VLLM=0 \
Expand All @@ -33,6 +41,7 @@ local_build:
docker buildx build \
--progress plain \
--load \
$(BUILD_ARGS) \
--build-arg BASE_IMAGE_BUILD=ubuntu:22.04 \
--build-arg BASE_IMAGE_RUN=ubuntu:22.04 \
--build-arg BUILD_WITH_VLLM=0 \
Expand Down

0 comments on commit 9b7c220

Please sign in to comment.