@@ -2,8 +2,10 @@ TAG ?= latest
22
33ifeq ($(LIBGIT2_ONLY ) ,true)
44 IMG ?= ghcr.io/fluxcd/golang-with-libgit2-only
5+ DOCKERFILE ?= Dockerfile.libgit2-only
56else
67 IMG ?= ghcr.io/fluxcd/golang-with-libgit2-all
8+ DOCKERFILE ?= Dockerfile
79endif
810
911PLATFORMS ?= linux/amd64,linux/arm/v7,linux/arm64
@@ -43,51 +45,33 @@ GO_STATIC_FLAGS=-tags 'netgo,osusergo,static_build'
4345
4446.PHONY : build
4547build :
46- ifeq ($(LIBGIT2_ONLY ) ,true)
47- docker buildx build \
48- --platform=$(PLATFORMS) \
49- --tag $(IMG):$(TAG) \
50- --file Dockerfile.libgit2-only \
51- $(BUILD_ARGS) .
52- else
5348 docker buildx build \
5449 --platform=$(PLATFORMS ) \
5550 --tag $(IMG ) :$(TAG ) \
56- --file Dockerfile \
51+ --file $( DOCKERFILE ) \
5752 $(BUILD_ARGS ) .
58- endif
5953
6054.PHONY : test
6155test :
62- ifeq ($(LIBGIT2_ONLY ) ,true)
63- docker buildx build \
64- --platform=$(PLATFORMS) \
65- --tag $(IMG):$(TAG)-test \
66- --build-arg LIBGIT2_IMG=$(IMG) \
67- --build-arg LIBGIT2_TAG=$(TAG) \
68- --file Dockerfile.test-libgit2-only \
69- $(BUILD_ARGS) .
70- else
7156 docker buildx build \
7257 --platform=$(PLATFORMS ) \
7358 --tag $(IMG ) :$(TAG ) -test \
7459 --build-arg LIBGIT2_IMG=$(IMG ) \
7560 --build-arg LIBGIT2_TAG=$(TAG ) \
76- --file Dockerfile.test \
61+ --file $( DOCKERFILE ) \
7762 $(BUILD_ARGS ) .
78- endif
7963
8064.PHONY : builder
8165builder :
82- # create local builder
66+ # create local builder
8367 docker buildx create --name local-builder \
8468 --platform $(PLATFORMS ) \
8569 --driver-opt network=host \
8670 --driver-opt env.BUILDKIT_STEP_LOG_MAX_SIZE=1073741274 \
8771 --driver-opt env.BUILDKIT_STEP_LOG_MAX_SPEED=5000000000000 \
8872 --buildkitd-flags ' --allow-insecure-entitlement security.insecure' \
8973 --use
90- # install qemu emulators
74+ # install qemu emulators
9175 docker run -it --rm --privileged tonistiigi/binfmt --install all
9276
9377$(LIBGIT2 ) : $(MUSL-CC )
10084 ./hack/static.sh all
10185endif
10286else
103- ifeq ($(LIBGIT2_ONLY ) ,true)
10487 IMG_TAG=$(IMG):$(TAG) ./hack/extract-libraries.sh
105- else
106- IMG_TAG=$(IMG):$(TAG) ./hack/extract-libraries.sh
107- endif
10888endif
10989
11090$(MUSL-CC ) :
0 commit comments