@@ -26,31 +26,23 @@ FLB_REPOSITORY ?= "https://github.com/amazon-contributing/upstream-to-fluent-bit
26
26
dev : DOCKER_BUILD_FLAGS =
27
27
dev : release
28
28
29
- .PHONY : release
30
- release : build build-init linux-plugins
31
- docker system prune -f
32
- docker build $(DOCKER_BUILD_FLAGS ) --build-arg AL_TAG=${AL_TAG} -t amazon/aws-for-fluent-bit:main-release -f ./scripts/dockerfiles/Dockerfile.main-release .
33
- docker tag amazon/aws-for-fluent-bit:main-release amazon/aws-for-fluent-bit:latest
34
- docker system prune -f
35
- docker build $(DOCKER_BUILD_FLAGS ) -t amazon/aws-for-fluent-bit:init-latest -f ./scripts/dockerfiles/Dockerfile.init-release .
36
-
37
- .PHONY : debug
38
- debug : main-debug init-debug
29
+ .PHONY : build-common
30
+ build-common :
31
+ docker build $(DOCKER_BUILD_FLAGS ) -t amazon/aws-for-fluent-bit:build-deps-al${AL_TAG} -f ./scripts/dockerfiles/build/Dockerfile.deps-al${AL_TAG} .
32
+ docker build $(DOCKER_BUILD_FLAGS ) --build-arg AL_TAG=${AL_TAG} --build-arg FLB_VERSION=${FLB_VERSION} --build-arg FLB_REPOSITORY=${FLB_REPOSITORY} -t amazon/aws-for-fluent-bit:build-common-al${AL_TAG} -f ./scripts/dockerfiles/build/Dockerfile.build-common .
33
+ docker build $(DOCKER_BUILD_FLAGS ) -t amazon/aws-for-fluent-bit:golang -f ./scripts/dockerfiles/build/Dockerfile.golang .
34
+ docker build $(DOCKER_BUILD_FLAGS ) -t amazon/aws-for-fluent-bit:compile-init-al${AL_TAG} -f ./scripts/dockerfiles/build/Dockerfile.compile-init .
39
35
40
36
.PHONY : build
41
- build :
42
- docker system prune -f
43
- docker build $(DOCKER_BUILD_FLAGS ) --build-arg AL_TAG=${AL_TAG} --build-arg FLB_VERSION=${FLB_VERSION} --build-arg FLB_REPOSITORY=${FLB_REPOSITORY} -t amazon/aws-for-fluent-bit:build -f ./scripts/dockerfiles/Dockerfile.build .
37
+ build : build-common
38
+ docker build $(DOCKER_BUILD_FLAGS ) --build-arg BUILD_IMAGE=amazon/aws-for-fluent-bit:build-common-al${AL_TAG} -t amazon/aws-for-fluent-bit:compile-al${AL_TAG} -f ./scripts/dockerfiles/build/Dockerfile.compile .
44
39
45
- .PHONY : build-init
46
- build-init :
47
- docker build $(DOCKER_BUILD_FLAGS ) --build-arg AL_TAG=${AL_TAG} -t amazon/aws-for-fluent-bit:build-init -f ./scripts/dockerfiles/Dockerfile.build-init .
48
-
49
- # TODO: the bash script opts does not work on developer Macs
50
- windows-plugins : export OS_TYPE = windows
51
- linux-plugins : export OS_TYPE = linux
40
+ .PHONY : build-debug
41
+ build-debug : build-common
42
+ docker build $(DOCKER_BUILD_FLAGS ) --build-arg BUILD_IMAGE=amazon/aws-for-fluent-bit:build-common-al${AL_TAG} --build-arg DEBUG=On --build-arg RELEASE=Off -t amazon/aws-for-fluent-bit:compile-debug-al${AL_TAG} -f ./scripts/dockerfiles/build/Dockerfile.compile .
52
43
53
44
.PHONY : windows-plugins
45
+ windows-plugins : export OS_TYPE = windows
54
46
windows-plugins :
55
47
./scripts/build_plugins.sh \
56
48
--KINESIS_PLUGIN_CLONE_URL=${KINESIS_PLUGIN_CLONE_URL} \
@@ -65,6 +57,7 @@ windows-plugins:
65
57
--DOCKER_BUILD_FLAGS=${DOCKER_BUILD_FLAGS}
66
58
67
59
.PHONY : linux-plugins
60
+ linux-plugins : export OS_TYPE = linux
68
61
linux-plugins :
69
62
./scripts/build_plugins.sh \
70
63
--KINESIS_PLUGIN_CLONE_URL=${KINESIS_PLUGIN_CLONE_URL} \
@@ -78,88 +71,64 @@ linux-plugins:
78
71
--CLOUDWATCH_PLUGIN_BRANCH=${CLOUDWATCH_PLUGIN_BRANCH} \
79
72
--DOCKER_BUILD_FLAGS=${DOCKER_BUILD_FLAGS}
80
73
81
- # Debug and debug init images
82
- .PHONY : main-debug
83
- main-debug : debug-s3
84
- docker tag amazon/aws-for-fluent-bit:debug-s3 amazon/aws-for-fluent-bit:debug
74
+ .PHONY : release
75
+ release : build linux-plugins
76
+ docker build $(DOCKER_BUILD_FLAGS ) -t amazon/aws-for-fluent-bit:runtime-deps-al${AL_TAG} -f ./scripts/dockerfiles/runtime/Dockerfile.deps-al${AL_TAG} .
77
+ docker build $(DOCKER_BUILD_FLAGS ) --build-arg COMPILE_IMAGE=amazon/aws-for-fluent-bit:compile-al${AL_TAG} --build-arg RUNTIME_IMAGE=amazon/aws-for-fluent-bit:runtime-deps-al${AL_TAG} -t amazon/aws-for-fluent-bit:latest-al${AL_TAG} -f ./scripts/dockerfiles/runtime/Dockerfile .
78
+ docker build $(DOCKER_BUILD_FLAGS ) --build-arg COMPILE_IMAGE=amazon/aws-for-fluent-bit:compile-init-al${AL_TAG} --build-arg RUNTIME_IMAGE=amazon/aws-for-fluent-bit:latest-al${AL_TAG} -t amazon/aws-for-fluent-bit:init-latest-al${AL_TAG} -f ./scripts/dockerfiles/runtime/Dockerfile.init .
85
79
86
- .PHONY : init-debug
87
- init-debug : init-debug-s3
88
- docker tag amazon/aws-for-fluent-bit:init-debug-s3 amazon/aws-for-fluent-bit:init-debug
80
+ .PHONY : debug
81
+ debug : build-debug linux-plugins
82
+ docker build $(DOCKER_BUILD_FLAGS ) -t amazon/aws-for-fluent-bit:runtime-deps-debug-al${AL_TAG} -f ./scripts/dockerfiles/runtime/Dockerfile.deps-debug-al${AL_TAG} .
83
+ docker build $(DOCKER_BUILD_FLAGS ) --build-arg COMPILE_IMAGE=amazon/aws-for-fluent-bit:compile-debug-al${AL_TAG} --build-arg RUNTIME_IMAGE=amazon/aws-for-fluent-bit:runtime-deps-debug-al${AL_TAG} -t amazon/aws-for-fluent-bit:runtime-debug-al${AL_TAG} -f ./scripts/dockerfiles/runtime/Dockerfile .
84
+ docker build $(DOCKER_BUILD_FLAGS ) --build-arg RUNTIME_IMAGE=amazon/aws-for-fluent-bit:runtime-debug-al${AL_TAG} -t amazon/aws-for-fluent-bit:runtime-debug-common-${AL_TAG} -f ./scripts/dockerfiles/runtime/Dockerfile.debug-common .
85
+ # s3 images
86
+ docker build $(DOCKER_BUILD_FLAGS) --build-arg RUNTIME_IMAGE=amazon/aws-for-fluent-bit:runtime-debug-common-${AL_TAG} -t amazon/aws-for-fluent-bit:debug-al${AL_TAG} -f ./scripts/dockerfiles/runtime/Dockerfile.debug .
87
+ docker build $(DOCKER_BUILD_FLAGS) --build-arg COMPILE_IMAGE=amazon/aws-for-fluent-bit:compile-init-al${AL_TAG} --build-arg RUNTIME_IMAGE=amazon/aws-for-fluent-bit:debug-al${AL_TAG} -t amazon/aws-for-fluent-bit:runtime-init-debug-al${AL_TAG} -f ./scripts/dockerfiles/runtime/Dockerfile.init .
88
+ docker build $(DOCKER_BUILD_FLAGS) --build-arg RUNTIME_IMAGE=amazon/aws-for-fluent-bit:runtime-init-debug-al${AL_TAG} -t amazon/aws-for-fluent-bit:init-debug-al${AL_TAG} -f ./scripts/dockerfiles/runtime/Dockerfile.init-debug .
89
+ # efs images
90
+ docker build $(DOCKER_BUILD_FLAGS) --build-arg RUNTIME_IMAGE=amazon/aws-for-fluent-bit:runtime-debug-common-${AL_TAG} -t amazon/aws-for-fluent-bit:debug-efs-al${AL_TAG} -f ./scripts/dockerfiles/runtime/Dockerfile.debug-efs .
91
+ docker build $(DOCKER_BUILD_FLAGS) --build-arg RUNTIME_IMAGE=amazon/aws-for-fluent-bit:runtime-init-debug-al${AL_TAG} -t amazon/aws-for-fluent-bit:init-debug-efs-al${AL_TAG} -f ./scripts/dockerfiles/runtime/Dockerfile.init-debug-efs .
89
92
90
- # Build all main debug images (Don't build the dependencies multiple times)
91
- .PHONY : main-debug-all
92
- main-debug-all : main-debug-base
93
- docker build $(DOCKER_BUILD_FLAGS ) -t amazon/aws-for-fluent-bit:debug-fs -f ./scripts/dockerfiles/Dockerfile.main-debug-fs .
94
- docker build $(DOCKER_BUILD_FLAGS ) -t amazon/aws-for-fluent-bit:debug-s3 -f ./scripts/dockerfiles/Dockerfile.main-debug-s3 .
95
- docker build $(DOCKER_BUILD_FLAGS ) -t amazon/aws-for-fluent-bit:debug-valgrind -f ./scripts/dockerfiles/Dockerfile.main-debug-valgrind .
96
- docker tag amazon/aws-for-fluent-bit:debug-s3 amazon/aws-for-fluent-bit:debug
93
+ .PHONY : debug-valgrind
94
+ debug-valgrind : debug
95
+ docker build $(DOCKER_BUILD_FLAGS ) --build-arg RUNTIME_IMAGE=amazon/aws-for-fluent-bit:runtime-debug-common-${AL_TAG} -t amazon/aws-for-fluent-bit:debug-valgrind-al${AL_TAG} -f ./scripts/dockerfiles/runtime/Dockerfile.debug-valgrind .
97
96
98
- # Debug images
99
- .PHONY : debug-fs
100
- debug-fs : main-debug-base
101
- docker build $(DOCKER_BUILD_FLAGS ) -t amazon/aws-for-fluent-bit:debug-fs -f ./scripts/dockerfiles/Dockerfile.main-debug-fs .
97
+ .PHONY : cloudwatch-dev
98
+ cloudwatch-dev : export OS_TYPE = linux
99
+ cloudwatch-dev : build
100
+ ./scripts/build_plugins.sh \
101
+ --CLOUDWATCH_PLUGIN_CLONE_URL=${CLOUDWATCH_PLUGIN_CLONE_URL} \
102
+ --CLOUDWATCH_PLUGIN_BRANCH=${CLOUDWATCH_PLUGIN_BRANCH} \
103
+ --DOCKER_BUILD_FLAGS=${DOCKER_BUILD_FLAGS}
104
+ docker build $(DOCKER_BUILD_FLAGS) -t amazon/aws-for-fluent-bit:runtime-deps-al${AL_TAG} -f ./scripts/dockerfiles/runtime/Dockerfile.deps-al${AL_TAG} .
105
+ docker build $(DOCKER_BUILD_FLAGS) --build-arg COMPILE_IMAGE=amazon/aws-for-fluent-bit:compile-al${AL_TAG} --build-arg RUNTIME_IMAGE=amazon/aws-for-fluent-bit:runtime-deps-al${AL_TAG} -t amazon/aws-for-fluent-bit:latest-al${AL_TAG} -f ./scripts/dockerfiles/runtime/Dockerfile .
102
106
103
- .PHONY : debug-s3
104
- debug-s3 : main-debug-base
105
- docker build $(DOCKER_BUILD_FLAGS ) -t amazon/aws-for-fluent-bit:debug-s3 -f ./scripts/dockerfiles/Dockerfile.main-debug-s3 .
107
+ .PHONY : firehose-dev
108
+ firehose-dev : export OS_TYPE = linux
109
+ firehose-dev : build
110
+ ./scripts/build_plugins.sh \
111
+ --FIREHOSE_PLUGIN_CLONE_URL=${FIREHOSE_PLUGIN_CLONE_URL} \
112
+ --FIREHOSE_PLUGIN_BRANCH=${FIREHOSE_PLUGIN_BRANCH} \
113
+ --DOCKER_BUILD_FLAGS=${DOCKER_BUILD_FLAGS}
114
+ docker build $(DOCKER_BUILD_FLAGS) -t amazon/aws-for-fluent-bit:runtime-deps-al${AL_TAG} -f ./scripts/dockerfiles/runtime/Dockerfile.deps-al${AL_TAG} .
115
+ docker build $(DOCKER_BUILD_FLAGS) --build-arg COMPILE_IMAGE=amazon/aws-for-fluent-bit:compile-al${AL_TAG} --build-arg RUNTIME_IMAGE=amazon/aws-for-fluent-bit:runtime-deps-al${AL_TAG} -t amazon/aws-for-fluent-bit:latest-al${AL_TAG} -f ./scripts/dockerfiles/runtime/Dockerfile .
106
116
107
- .PHONY : debug-valgrind
108
- debug-valgrind : main-debug-base
109
- docker build $(DOCKER_BUILD_FLAGS ) -t amazon/aws-for-fluent-bit:debug-valgrind -f ./scripts/dockerfiles/Dockerfile.main-debug-valgrind .
110
-
111
- # Build all init debug images (Don't build the dependencies multiple times)
112
- .PHONY : init-debug-all
113
- init-debug-all : main-debug-base build-init
114
- docker build $(DOCKER_BUILD_FLAGS ) -t amazon/aws-for-fluent-bit:init-debug-base -f ./scripts/dockerfiles/Dockerfile.init-debug-base .
115
- docker build $(DOCKER_BUILD_FLAGS ) -t amazon/aws-for-fluent-bit:init-debug-fs -f ./scripts/dockerfiles/Dockerfile.init-debug-fs .
116
- docker build $(DOCKER_BUILD_FLAGS ) -t amazon/aws-for-fluent-bit:init-debug-s3 -f ./scripts/dockerfiles/Dockerfile.init-debug-s3 .
117
- docker tag amazon/aws-for-fluent-bit:init-debug-s3 amazon/aws-for-fluent-bit:init-debug
118
-
119
- # Debug init images
120
- .PHONY : init-debug-fs
121
- init-debug-fs : main-debug-base build-init
122
- docker build $(DOCKER_BUILD_FLAGS ) -t amazon/aws-for-fluent-bit:init-debug-base -f ./scripts/dockerfiles/Dockerfile.init-debug-base .
123
- docker build $(DOCKER_BUILD_FLAGS ) -t amazon/aws-for-fluent-bit:init-debug-fs -f ./scripts/dockerfiles/Dockerfile.init-debug-fs .
124
-
125
- .PHONY : init-debug-s3
126
- init-debug-s3 : main-debug-base build-init
127
- docker build $(DOCKER_BUILD_FLAGS ) -t amazon/aws-for-fluent-bit:init-debug-base -f ./scripts/dockerfiles/Dockerfile.init-debug-base .
128
- docker build $(DOCKER_BUILD_FLAGS ) -t amazon/aws-for-fluent-bit:init-debug-s3 -f ./scripts/dockerfiles/Dockerfile.init-debug-s3 .
129
-
130
- .PHONY : main-debug-base
131
- main-debug-base : build linux-plugins
132
- docker build $(DOCKER_BUILD_FLAGS ) --build-arg AL_TAG=${AL_TAG} -t amazon/aws-for-fluent-bit:main-debug-base -f ./scripts/dockerfiles/Dockerfile.main-debug-base .
117
+ .PHONY : kinesis-dev
118
+ kinesis-dev : export OS_TYPE = linux
119
+ kinesis-dev : build
120
+ ./scripts/build_plugins.sh \
121
+ --KINESIS_PLUGIN_CLONE_URL=${KINESIS_PLUGIN_CLONE_URL} \
122
+ --KINESIS_PLUGIN_BRANCH=${KINESIS_PLUGIN_BRANCH} \
123
+ --DOCKER_BUILD_FLAGS=${DOCKER_BUILD_FLAGS}
124
+ docker build $(DOCKER_BUILD_FLAGS) -t amazon/aws-for-fluent-bit:runtime-deps-al${AL_TAG} -f ./scripts/dockerfiles/runtime/Dockerfile.deps-al${AL_TAG} .
125
+ docker build $(DOCKER_BUILD_FLAGS) --build-arg COMPILE_IMAGE=amazon/aws-for-fluent-bit:compile-al${AL_TAG} --build-arg RUNTIME_IMAGE=amazon/aws-for-fluent-bit:runtime-deps-al${AL_TAG} -t amazon/aws-for-fluent-bit:latest-al${AL_TAG} -f ./scripts/dockerfiles/runtime/Dockerfile .
133
126
134
127
.PHONY : validate-version-file-format
135
128
validate-version-file-format :
136
129
jq -e . windows.versions && true || false
137
130
jq -e . linux.version && true || false
138
131
139
- .PHONY : cloudwatch-dev
140
- cloudwatch-dev :
141
- docker build \
142
- --build-arg CLOUDWATCH_PLUGIN_CLONE_URL=${CLOUDWATCH_PLUGIN_CLONE_URL} \
143
- --build-arg CLOUDWATCH_PLUGIN_BRANCH=${CLOUDWATCH_PLUGIN_BRANCH} \
144
- $(DOCKER_BUILD_FLAGS ) --build-arg AL_TAG=${AL_TAG} -t aws-fluent-bit-plugins:latest -f ./scripts/dockerfiles/Dockerfile.plugins .
145
- docker build -t amazon/aws-for-fluent-bit:latest -f ./scripts/dockerfiles/Dockerfile .
146
-
147
- .PHONY : firehose-dev
148
- firehose-dev :
149
- docker build \
150
- --build-arg FIREHOSE_PLUGIN_CLONE_URL=${FIREHOSE_PLUGIN_CLONE_URL} \
151
- --build-arg FIREHOSE_PLUGIN_BRANCH=${FIREHOSE_PLUGIN_BRANCH} \
152
- $(DOCKER_BUILD_FLAGS ) --build-arg AL_TAG=${AL_TAG} -t aws-fluent-bit-plugins:latest -f ./scripts/dockerfiles/Dockerfile.plugins .
153
- docker build -t amazon/aws-for-fluent-bit:latest -f ./scripts/dockerfiles/Dockerfile .
154
-
155
- .PHONY : kinesis-dev
156
- kinesis-dev :
157
- docker build \
158
- --build-arg KINESIS_PLUGIN_CLONE_URL=${KINESIS_PLUGIN_CLONE_URL} \
159
- --build-arg KINESIS_PLUGIN_BRANCH=${KINESIS_PLUGIN_BRANCH} \
160
- $(DOCKER_BUILD_FLAGS ) --build-arg AL_TAG=${AL_TAG} -t aws-fluent-bit-plugins:latest -f ./scripts/dockerfiles/Dockerfile.plugins .
161
- docker build -t amazon/aws-for-fluent-bit:latest -f ./scripts/dockerfiles/Dockerfile .
162
-
163
132
integ/out :
164
133
mkdir -p integ/out
165
134
@@ -214,26 +183,10 @@ delete-resources:
214
183
215
184
.PHONY : clean
216
185
clean :
217
- rm -rf ./build
218
- rm -rf ./integ/out
219
- docker image remove -f aws-fluent-bit-plugins:latest
220
-
221
- docker image remove -f amazon/aws-for-fluent-bit:latest
222
- docker image remove -f amazon/aws-for-fluent-bit:init-latest
223
- docker image remove -f amazon/aws-for-fluent-bit:debug
224
- docker image remove -f amazon/aws-for-fluent-bit:init-debug
225
-
226
- docker image remove -f amazon/aws-for-fluent-bit:build
227
- docker image remove -f amazon/aws-for-fluent-bit:build-init
228
- docker image remove -f amazon/aws-for-fluent-bit:init-debug-base
229
- docker image remove -f amazon/aws-for-fluent-bit:main-debug-base
230
-
231
- docker image remove -f amazon/aws-for-fluent-bit:init-release
232
- docker image remove -f amazon/aws-for-fluent-bit:main-release
233
- docker image remove -f amazon/aws-for-fluent-bit:debug-fs
234
- docker image remove -f amazon/aws-for-fluent-bit:debug-s3
235
- docker image remove -f amazon/aws-for-fluent-bit:debug-valgrind
236
- docker image remove -f amazon/aws-for-fluent-bit:init-debug-fs
237
- docker image remove -f amazon/aws-for-fluent-bit:init-debug-s3
238
-
239
- docker image prune -f
186
+ rm -rf ./build ./integ/out
187
+ # Remove all amazon/aws-for-fluent-bit tagged images
188
+ docker images --format "table {{.Repository}}:{{.Tag}}" | grep "^amazon/aws-for-fluent-bit:" | xargs -r docker image remove -f
189
+ # Remove aws-fluent-bit-plugins images
190
+ docker images --format "table {{.Repository}}:{{.Tag}}" | grep "^aws-fluent-bit-plugins:" | xargs -r docker image remove -f
191
+ # Clean up dangling images
192
+ docker image prune -a -f
0 commit comments