Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add docker bake #1111

Merged
merged 2 commits into from
Feb 5, 2024
Merged

feat: add docker bake #1111

merged 2 commits into from
Feb 5, 2024

Conversation

akijakya
Copy link
Contributor

@akijakya akijakya commented Jan 21, 2024

Description

Added Docker Bake to streamline docker builds, also modified the Makefile use bake for building and pushing images to the repository.

Modifying the CI will come in another PR.

Build time remained the same, but using Docker Bake comes with some advantages:

modularity 🧱

  • from now on Dockerfiles can exist in any place, number, or name within the repo (or even remote URLs can be used); they can be referred to properly in docker-bake.hcl with the context and dockerfile fields
  • multiple images can be built at once via target groups

tidiness ✨

  • Makefile is a bit cleaner now by not having to specify the same build commands per each image

Fixes #1085

Type of Change

[ ] Bug Fix
[X] New Feature
[ ] Breaking Change
[X] Refactor
[ ] Documentation
[ ] Other (please describe)

Checklist

  • I have read the contributing guidelines
  • Existing issues have been referenced (where applicable)
  • I have verified this change is not present in other open pull requests
  • Functionality is documented
  • All code style checks pass
  • New code contribution is covered by automated tests
  • All new and existing tests pass

@akijakya akijakya added docker Pull requests that update Docker code github actions Pull requests that update GitHub Actions code github_actions Pull requests that update GitHub Actions code ci Continious Integration related PRs labels Jan 21, 2024
@akijakya akijakya self-assigned this Jan 21, 2024
@akijakya akijakya requested a review from a team as a code owner January 21, 2024 14:01
@akijakya akijakya force-pushed the add-docker-bake branch 3 times, most recently from 75007c6 to bfa98a4 Compare January 21, 2024 15:44

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

@akijakya akijakya force-pushed the add-docker-bake branch 2 times, most recently from 99e8ded to 333b285 Compare January 21, 2024 23:55

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

@akijakya akijakya force-pushed the add-docker-bake branch 2 times, most recently from da42bee to dacb6dd Compare January 22, 2024 16:45

This comment has been minimized.

@akijakya akijakya force-pushed the add-docker-bake branch 3 times, most recently from 64b55bd to b1d7dde Compare January 25, 2024 15:47

This comment has been minimized.

This comment has been minimized.

@akijakya akijakya marked this pull request as ready for review January 25, 2024 20:38
docker-bake.hcl Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
.github/workflows/build-and-push-component.yaml Outdated Show resolved Hide resolved
.github/workflows/build-and-push-component.yaml Outdated Show resolved Hide resolved
.github/workflows/build-and-push-component.yaml Outdated Show resolved Hide resolved
.github/workflows/build-and-push-component.yaml Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
docker-bake.hcl Outdated Show resolved Hide resolved
docker-bake.hcl Show resolved Hide resolved
@akijakya akijakya force-pushed the add-docker-bake branch 4 times, most recently from d913f9f to fc81bfe Compare February 2, 2024 15:23

This comment has been minimized.

Makefile Outdated Show resolved Hide resolved
docker-bake.hcl Outdated Show resolved Hide resolved
docker-bake.hcl Outdated Show resolved Hide resolved
docker-bake.hcl Outdated Show resolved Hide resolved
docker-bake.hcl Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
Signed-off-by: András Jáky <ajaky@cisco.com>

This comment has been minimized.

Signed-off-by: András Jáky <ajaky@cisco.com>
Copy link

github-actions bot commented Feb 5, 2024

Hey!

Your images are ready:

  • ghcr.io/openclarity/vmclarity-apiserver-dev:pr1111-17f57b07d5680e8131a268ae5662515151b8c3c2
  • ghcr.io/openclarity/vmclarity-orchestrator-dev:pr1111-17f57b07d5680e8131a268ae5662515151b8c3c2
  • ghcr.io/openclarity/vmclarity-ui-backend-dev:pr1111-17f57b07d5680e8131a268ae5662515151b8c3c2
  • ghcr.io/openclarity/vmclarity-ui-dev:pr1111-17f57b07d5680e8131a268ae5662515151b8c3c2
  • ghcr.io/openclarity/vmclarity-cli-dev:pr1111-17f57b07d5680e8131a268ae5662515151b8c3c2
  • ghcr.io/openclarity/vmclarity-cr-discovery-server-dev:pr1111-17f57b07d5680e8131a268ae5662515151b8c3c2

Copy link
Member

@ramizpolic ramizpolic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, tested make & bake and it works properly now, thanks @akijakya!

Copy link
Contributor

@chrisgacsal chrisgacsal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! :shipit:

@akijakya akijakya added this pull request to the merge queue Feb 5, 2024
@akijakya akijakya removed github actions Pull requests that update GitHub Actions code github_actions Pull requests that update GitHub Actions code ci Continious Integration related PRs labels Feb 5, 2024
Merged via the queue into main with commit ccdfd29 Feb 5, 2024
37 checks passed
@akijakya akijakya deleted the add-docker-bake branch February 5, 2024 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docker Pull requests that update Docker code
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Use Bake for Docker builds
3 participants