Skip to content

Commit

Permalink
Use a go build cache to speed up builds.
Browse files Browse the repository at this point in the history
With a docker build cache already primed with the build image I am seeing
`time make build -f docker.Makefile DOCKER_BUILDKIT=1 GO_BUILD_CACHE=n` takes
more than 1 minute.

By contrast `time make build -f docker.Makefile DOCKER_BUILDKIT=1
GO_BUILD_CACHE=y` takes less than 10s with a hot cache irrespective of whether
the source tree has changed

Signed-off-by: Ian Campbell <ijc@docker.com>
  • Loading branch information
Ian Campbell committed Dec 11, 2018
1 parent 7c8ee78 commit 0595934
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docker.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ LINTER_IMAGE_NAME = docker-cli-lint$(IMAGE_TAG)
CROSS_IMAGE_NAME = docker-cli-cross$(IMAGE_TAG)
VALIDATE_IMAGE_NAME = docker-cli-shell-validate$(IMAGE_TAG)
E2E_IMAGE_NAME = docker-cli-e2e$(IMAGE_TAG)
GO_BUILD_CACHE ?= y
MOUNTS = -v "$(CURDIR)":/go/src/github.com/docker/cli
ifeq ($(GO_BUILD_CACHE),y)
MOUNTS += -v "docker-cli-dev-cache:/root/.cache/go-build"
endif
VERSION = $(shell cat VERSION)
ENVVARS = -e VERSION=$(VERSION) -e GITCOMMIT -e PLATFORM

Expand Down

0 comments on commit 0595934

Please sign in to comment.