Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
!.goreleaser*
!.golangci*
!.mockery.yaml
!.requirements
!build/scripts
!cmd
!examples
Expand Down
37 changes: 0 additions & 37 deletions .github/workflows/ecr-publish-build.yaml

This file was deleted.

12 changes: 0 additions & 12 deletions .github/workflows/test-and-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,3 @@ jobs:
run: make check-schema
- name: Lint
run: make lint
image:
name: Build and check image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
fetch-depth: 0
- name: Setup build environment
uses: ./.github/actions/setup-build
- name: build
run: make -f Makefile.docker check-build-image-manifest-up-to-date
2 changes: 1 addition & 1 deletion .requirements
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ github.com/maxbrunsfeld/counterfeiter/v6
github.com/cloudflare/cfssl/cmd/cfssl@v1.6.5
github.com/cloudflare/cfssl/cmd/cfssljson@v1.6.5
github.com/golangci/golangci-lint/cmd/golangci-lint
github.com/onsi/ginkgo/v2/ginkgo@v2.22.2
github.com/onsi/ginkgo/v2/ginkgo
github.com/vektra/mockery/v2
github.com/github-release/github-release
k8s.io/code-generator/cmd/client-gen
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax=docker/dockerfile:1
FROM public.ecr.aws/docker/library/golang:1.24.0 AS builder
FROM public.ecr.aws/docker/library/golang:1.24.2 AS builder

WORKDIR /src
COPY . .
Expand All @@ -14,6 +14,6 @@ RUN <<EOT
chown 65532 eksctl
EOT

FROM public.ecr.aws/eks-distro/kubernetes/go-runner:v0.16.4-eks-1-32-6 AS go-runner
FROM public.ecr.aws/eks-distro/kubernetes/go-runner:v0.18.0-eks-1-32-10 AS go-runner
COPY --from=builder /src/eksctl /eksctl
ENTRYPOINT ["/eksctl"]
54 changes: 0 additions & 54 deletions Makefile.docker
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,6 @@ export PATH := ./build/scripts:$(PATH)

image_manifest_file = build/docker/build_image_manifest

# We use git object hashes for determining the input files used for any given build image
# E.g. given `public.ecr.aws/eksctl/eksctl-build:d94225a6dbb6dfab6dd185442ae554432f9365dc` one can
# run `git show d94225a6dbb6dfab6dd185442ae554432f9365dc` to get contents of `.build_image_manifest`,
# and `git show <hash>` for each of the hashes in the manifest to determine contents of each of the
# files used in `$(build_image_input)` at the time.
build_image_tag_file = build/docker/image_tag
build_image_tag = $(shell cat $(build_image_tag_file))

build_image = public.ecr.aws/eksctl/eksctl-build
build_image_name = $(build_image):$(build_image_tag)

eksctl_image = public.ecr.aws/eksctl/eksctl
eksctl_image_name = "$(eksctl_image):$${EKSCTL_IMAGE_VERSION}"

Expand All @@ -33,55 +22,12 @@ endif
authenticate-ecr-for-docker: ## Get ECR public registry credentials with AWS credentials
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws

.PHONY: update-build-image-tag
update-build-image-tag: ## Update the build image tag as referenced across the repo
build-image-manifest.sh > $(image_manifest_file)
git hash-object $(image_manifest_file) > $(build_image_tag_file)
sed $(sedi) -e "1s|\(BUILD_IMAGE=\).*|\1$(build_image):$$(cat $(build_image_tag_file))|" Dockerfile
find .github/workflows -type f | xargs sed $(sedi) -e "s|\($(build_image):\).*|\1$$(cat $(build_image_tag_file))|"

.PHONY: check-build-image-manifest-up-to-date
check-build-image-manifest-up-to-date: update-build-image-tag ## Update build image manifest and commits the changes
git diff --quiet -- $(image_manifest_file) \
|| (git --no-pager diff $(image_manifest_file); echo "HINT: to fix this, run 'make -f Makefile.docker update-build-image-tag' then 'commit-new-image-tag'"; exit 1)

.PHONY: commit-new-image-tag
commit-new-image-tag: ## Update build image manifest and commits the changes
git add -u
git commit --message 'Update build image manifest, tag file and workflows'
@echo "Remember to run \"Publish ECR eksctl-build image\" GitHub workflow after merging these image tag changes"

.PHONY: build-image
build-image: check-build-image-manifest-up-to-date ## Build the build image that has all of external dependencies
-docker pull $(build_image_name)
cp .requirements build/scripts/install-build-deps.sh go.mod go.sum build/docker/
$(docker_build) \
--cache-from=$(build_image_name) \
--tag=$(build_image_name) \
build/docker/

.PHONY: push-build-image
push-build-image: authenticate-ecr-for-docker build-image ## Push the build image to the ECR public registry
docker push $(build_image_name)
@echo "Remember to commit the image_tag and build_image_manifest files"

.PHONY: eksctl-image
eksctl-image: ## Build the eksctl image that has release artefacts and no build dependencies
docker pull $(build_image_name)
$(docker_build) \
--cache-from=$(build_image_name) \
--tag=$(eksctl_image_name) \
--build-arg=BUILD_IMAGE=$(build_image_name) \
$(git_toplevel)

.PHONY: eksctl-image
push-eksctl-image: eksctl-image ## Push the eksctl image to the ECR public registry
docker push $(eksctl_image_name)

.PHONY: build-test
build-test: ## Run targets from Makefile using the build image
time docker run \
--tty \
--rm \
--volume=$(git_toplevel):/src \
$(build_image_name) make $@
4 changes: 0 additions & 4 deletions build/build_image_manifest

This file was deleted.

56 changes: 0 additions & 56 deletions build/docker/Dockerfile

This file was deleted.

17 changes: 0 additions & 17 deletions build/docker/build_image_manifest

This file was deleted.

1 change: 0 additions & 1 deletion build/docker/image_tag

This file was deleted.

21 changes: 0 additions & 21 deletions build/scripts/build-image-manifest.sh

This file was deleted.

Loading