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(depot): add depot image builder and pusher #4397

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

goller
Copy link

@goller goller commented Nov 1, 2023

Depot is a fast way to build and push docker images.

This is my draft to add depot with minimal changes to the docker build and push.
The key difference compared to the existing docker code is that depot can both build
and push multi-platform images in one step.

This PR does some refactoring of the imager interface to allow the build function to optionally return
a digest that signifies the pushed image. I'm not sure if this is the right approach; let me know!

( no tests yet ... I'm not sure yet how to proceed as I think the tests
may need a refactor to accommodate simultaneous build and push)

So, this commit adds use: depot to the docker builder allowing images to be build and pushed using depot.dev.
Additionally, a new optional docker setting, depot_project, can explicitly set the project.
Note that the project can also be set via the env var, DEPOT_PROJECT_ID or with a local file, depot.json.

depot.dev is a hosted buildkit that is a fast way build and push multi-platform images.

Here is the ticket about depot: #3746

Depot is a fast way to build and push docker images.

Signed-off-by: Chris Goller <goller@gmail.com>
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 1, 2023
Copy link
Member

@caarlos0 caarlos0 left a comment

Choose a reason for hiding this comment

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

one comment, but looks to me overall

@@ -1040,6 +1040,7 @@ type Docker struct {
BuildFlagTemplates []string `yaml:"build_flag_templates,omitempty" json:"build_flag_templates,omitempty"`
PushFlags []string `yaml:"push_flags,omitempty" json:"push_flags,omitempty"`
Use string `yaml:"use,omitempty" json:"use,omitempty" jsonschema:"enum=docker,enum=buildx,default=docker"`
DepotProject string `yaml:"depot_project,omitempty" json:"depot_project,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

Assuming we might add more things later (either for depot or for something else), maybe something like:

dockers:
- use: depot
  depot:
    project: foo

wdyt?

Copy link
Author

Choose a reason for hiding this comment

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

@caarlos0 Sounds great ! I've added that in 27eba41

Signed-off-by: Chris Goller <goller@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants