Skip to content

Commit 0b99656

Browse files
authored
Revert "Rework AL2 dockerfiles (#967)" (#971)
Unblock a pending release This reverts commit 49c943b.
1 parent 49c943b commit 0b99656

27 files changed

+496
-398
lines changed

Makefile

Lines changed: 114 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,31 @@ FLB_REPOSITORY ?= "https://github.com/amazon-contributing/upstream-to-fluent-bit
2626
dev: DOCKER_BUILD_FLAGS =
2727
dev: release
2828

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 .
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
3539

3640
.PHONY: 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 .
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 .
3944

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 .
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 .
4348

44-
.PHONY: windows-plugins
49+
#TODO: the bash script opts does not work on developer Macs
4550
windows-plugins: export OS_TYPE = windows
51+
linux-plugins: export OS_TYPE = linux
52+
53+
.PHONY: windows-plugins
4654
windows-plugins:
4755
./scripts/build_plugins.sh \
4856
--KINESIS_PLUGIN_CLONE_URL=${KINESIS_PLUGIN_CLONE_URL} \
@@ -57,7 +65,6 @@ windows-plugins:
5765
--DOCKER_BUILD_FLAGS=${DOCKER_BUILD_FLAGS}
5866

5967
.PHONY: linux-plugins
60-
linux-plugins: export OS_TYPE = linux
6168
linux-plugins:
6269
./scripts/build_plugins.sh \
6370
--KINESIS_PLUGIN_CLONE_URL=${KINESIS_PLUGIN_CLONE_URL} \
@@ -71,64 +78,88 @@ linux-plugins:
7178
--CLOUDWATCH_PLUGIN_BRANCH=${CLOUDWATCH_PLUGIN_BRANCH} \
7279
--DOCKER_BUILD_FLAGS=${DOCKER_BUILD_FLAGS}
7380

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 .
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
7985

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 .
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
9289

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 .
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
9697

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 .
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 .
106102

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 .
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 .
116106

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 .
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 .
126133

127134
.PHONY: validate-version-file-format
128135
validate-version-file-format:
129136
jq -e . windows.versions && true || false
130137
jq -e . linux.version && true || false
131138

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+
132163
integ/out:
133164
mkdir -p integ/out
134165

@@ -183,10 +214,26 @@ delete-resources:
183214

184215
.PHONY: clean
185216
clean:
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
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

README.md

Lines changed: 3 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -401,10 +401,9 @@ The `AL_TAG` variable affects all Docker builds in the Makefile, including:
401401
- `make release` - Release image build
402402
- `make dev` - Development image build
403403
- `make build` - Main build target
404-
- `make build-common` - Common build dependencies
405-
- `make build-debug` - Debug build target
406-
- `make debug` - Debug images with multiple variants
407-
- Plugin builds (`linux-plugins`, `windows-plugins`, etc.)
404+
- `make build-init` - Init container build
405+
- `make main-debug-base` - Debug image build
406+
- Plugin builds (`linux-plugins`, `cloudwatch-plugins`, etc.)
408407

409408
##### Customizing Fluent Bit Version and Repository
410409

@@ -479,43 +478,6 @@ To run integration tests separately, execute `make integ-cloudwatch` or `make in
479478

480479
[Documentation on GitHub steps for releases](Release_Process.md).
481480

482-
#### Available Make Targets
483-
484-
**Main Build Targets:**
485-
- `make all` - Default target, builds release image (same as `make release`)
486-
- `make release` - Builds the production release image with `--no-cache` option
487-
- `make dev` - Builds the image with Docker caching enabled for faster development
488-
- `make build` - Main build target for compilation
489-
- `make build-common` - Builds common build dependencies
490-
- `make build-debug` - Builds debug version with debug symbols
491-
492-
**Debug Targets:**
493-
- `make debug` - Builds debug images with multiple variants (S3 and EFS)
494-
- `make debug-valgrind` - Builds debug image with Valgrind for memory debugging
495-
496-
**Plugin Build Targets:**
497-
- `make linux-plugins` - Builds all AWS plugins for Linux
498-
- `make windows-plugins` - Builds all AWS plugins for Windows
499-
- `make cloudwatch-dev` - Builds image with only CloudWatch plugin for development
500-
- `make firehose-dev` - Builds image with only Firehose plugin for development
501-
- `make kinesis-dev` - Builds image with only Kinesis plugin for development
502-
503-
**Integration Test Targets:**
504-
- `make integ` - Runs CICD integration tests
505-
- `make integ-dev` - Runs all integration tests in development mode
506-
- `make integ-cloudwatch` / `make integ-cloudwatch-dev` - CloudWatch integration tests
507-
- `make integ-kinesis` / `make integ-kinesis-dev` - Kinesis integration tests
508-
- `make integ-firehose` / `make integ-firehose-dev` - Firehose integration tests
509-
510-
**Cleanup Targets:**
511-
- `make integ-clean-cloudwatch` - Cleans up CloudWatch integration test resources
512-
- `make integ-clean-s3` - Cleans up S3 integration test resources
513-
- `make delete-resources` - Deletes all integration test resources
514-
- `make clean` - Removes build artifacts and Docker images
515-
516-
**Utility Targets:**
517-
- `make validate-version-file-format` - Validates the format of version files
518-
519481
#### Developing Features in the AWS Plugins
520482

521483
You can build a version of the image with code in your GitHub fork. To do so, you must need to set the following environment variables.

buildspec.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ phases:
1111
commands:
1212
# Check latest image versions from dockerhub and from GitHub source file
1313
- './scripts/publish.sh cicd-check-image-version'
14-
# Enable buildkit features
15-
- export DOCKER_BUILDKIT=1
1614
# Command to build debug image
1715
- make debug
1816
# Command to build your project
@@ -24,16 +22,16 @@ phases:
2422
# Push the image to ECR with corresponding architecture as the tag.
2523
- aws ecr get-login-password --region ${AWS_REGION}| docker login --username AWS --password-stdin ${AWS_ACCOUNT}.dkr.ecr.${AWS_REGION}.amazonaws.com
2624
- aws ecr create-repository --repository-name amazon/aws-for-fluent-bit-test --image-scanning-configuration scanOnPush=true --region ${AWS_REGION} || true
27-
- architecture=$(docker inspect --format='{{.Architecture}}' amazon/aws-for-fluent-bit:latest-al2)
28-
- docker tag amazon/aws-for-fluent-bit:latest-al2 ${AWS_ACCOUNT}.dkr.ecr.${AWS_REGION}.amazonaws.com/amazon/aws-for-fluent-bit-test:$architecture
29-
- docker tag amazon/aws-for-fluent-bit:debug-al2 ${AWS_ACCOUNT}.dkr.ecr.${AWS_REGION}.amazonaws.com/amazon/aws-for-fluent-bit-test:$architecture-debug
25+
- architecture=$(docker inspect --format='{{.Architecture}}' amazon/aws-for-fluent-bit)
26+
- docker tag amazon/aws-for-fluent-bit:latest ${AWS_ACCOUNT}.dkr.ecr.${AWS_REGION}.amazonaws.com/amazon/aws-for-fluent-bit-test:$architecture
27+
- docker tag amazon/aws-for-fluent-bit:debug ${AWS_ACCOUNT}.dkr.ecr.${AWS_REGION}.amazonaws.com/amazon/aws-for-fluent-bit-test:$architecture-debug
3028
- docker push ${AWS_ACCOUNT}.dkr.ecr.${AWS_REGION}.amazonaws.com/amazon/aws-for-fluent-bit-test:$architecture
3129
- docker push ${AWS_ACCOUNT}.dkr.ecr.${AWS_REGION}.amazonaws.com/amazon/aws-for-fluent-bit-test:$architecture-debug
3230
- './scripts/publish.sh cicd-verify-ecr-image-scan ${AWS_REGION} amazon/aws-for-fluent-bit-test $architecture'
3331
- './scripts/publish.sh cicd-verify-ecr-image-scan ${AWS_REGION} amazon/aws-for-fluent-bit-test $architecture-debug'
3432
# Image with Init Process
35-
- docker tag amazon/aws-for-fluent-bit:init-latest-al2 ${AWS_ACCOUNT}.dkr.ecr.${AWS_REGION}.amazonaws.com/amazon/aws-for-fluent-bit-test:init-$architecture
36-
- docker tag amazon/aws-for-fluent-bit:init-debug-al2 ${AWS_ACCOUNT}.dkr.ecr.${AWS_REGION}.amazonaws.com/amazon/aws-for-fluent-bit-test:init-$architecture-debug
33+
- docker tag amazon/aws-for-fluent-bit:init-latest ${AWS_ACCOUNT}.dkr.ecr.${AWS_REGION}.amazonaws.com/amazon/aws-for-fluent-bit-test:init-$architecture
34+
- docker tag amazon/aws-for-fluent-bit:init-debug ${AWS_ACCOUNT}.dkr.ecr.${AWS_REGION}.amazonaws.com/amazon/aws-for-fluent-bit-test:init-$architecture-debug
3735
- docker push ${AWS_ACCOUNT}.dkr.ecr.${AWS_REGION}.amazonaws.com/amazon/aws-for-fluent-bit-test:init-$architecture
3836
- docker push ${AWS_ACCOUNT}.dkr.ecr.${AWS_REGION}.amazonaws.com/amazon/aws-for-fluent-bit-test:init-$architecture-debug
3937
- './scripts/publish.sh cicd-verify-ecr-image-scan ${AWS_REGION} amazon/aws-for-fluent-bit-test init-$architecture'

0 commit comments

Comments
 (0)