@@ -2,8 +2,10 @@ TAG ?= latest
2
2
3
3
ifeq ($(LIBGIT2_ONLY ) ,true)
4
4
IMG ?= ghcr.io/fluxcd/golang-with-libgit2-only
5
+ DOCKERFILE ?= Dockerfile.libgit2-only
5
6
else
6
7
IMG ?= ghcr.io/fluxcd/golang-with-libgit2-all
8
+ DOCKERFILE ?= Dockerfile
7
9
endif
8
10
9
11
PLATFORMS ?= linux/amd64,linux/arm/v7,linux/arm64
@@ -43,51 +45,33 @@ GO_STATIC_FLAGS=-tags 'netgo,osusergo,static_build'
43
45
44
46
.PHONY : build
45
47
build :
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
53
48
docker buildx build \
54
49
--platform=$(PLATFORMS ) \
55
50
--tag $(IMG ) :$(TAG ) \
56
- --file Dockerfile \
51
+ --file $( DOCKERFILE ) \
57
52
$(BUILD_ARGS ) .
58
- endif
59
53
60
54
.PHONY : test
61
55
test :
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
71
56
docker buildx build \
72
57
--platform=$(PLATFORMS ) \
73
58
--tag $(IMG ) :$(TAG ) -test \
74
59
--build-arg LIBGIT2_IMG=$(IMG ) \
75
60
--build-arg LIBGIT2_TAG=$(TAG ) \
76
- --file Dockerfile.test \
61
+ --file $( DOCKERFILE ) \
77
62
$(BUILD_ARGS ) .
78
- endif
79
63
80
64
.PHONY : builder
81
65
builder :
82
- # create local builder
66
+ # create local builder
83
67
docker buildx create --name local-builder \
84
68
--platform $(PLATFORMS ) \
85
69
--driver-opt network=host \
86
70
--driver-opt env.BUILDKIT_STEP_LOG_MAX_SIZE=1073741274 \
87
71
--driver-opt env.BUILDKIT_STEP_LOG_MAX_SPEED=5000000000000 \
88
72
--buildkitd-flags ' --allow-insecure-entitlement security.insecure' \
89
73
--use
90
- # install qemu emulators
74
+ # install qemu emulators
91
75
docker run -it --rm --privileged tonistiigi/binfmt --install all
92
76
93
77
$(LIBGIT2 ) : $(MUSL-CC )
100
84
./hack/static.sh all
101
85
endif
102
86
else
103
- ifeq ($(LIBGIT2_ONLY ) ,true)
104
87
IMG_TAG=$(IMG):$(TAG) ./hack/extract-libraries.sh
105
- else
106
- IMG_TAG=$(IMG):$(TAG) ./hack/extract-libraries.sh
107
- endif
108
88
endif
109
89
110
90
$(MUSL-CC ) :
0 commit comments