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

Support TemplateField for build.artifacts.docker.cliFlags #9582

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kitagry
Copy link

@kitagry kitagry commented Nov 23, 2024

Fixes: #9581

Description

Upon installing Docker Buildx, the docker build command becomes an alias for docker buildx build. This means that any subsequent docker build commands will be executed using the more advanced features provided by Buildx. Specifically, we intend to leverage the --cache-to=type=registry,ref=repo/image:tag flag within these commands. In order to several registry, I want to TemplateField for build.artifacts.docker.cliFlags as following.

build:
  artifacts:
    - image: repo/image
      context: .
      docker:
        dockerfile: Dockerfile
        cliFlags:
          - "--cache-to={{ .IMAGE_REPO }}/{{ .IMAGE_NAME }}:latest-cache"

User facing changes (remove if N/A)

User can use TemplateField in cliFlags.

Copy link

google-cla bot commented Nov 23, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@louisjimenez louisjimenez self-requested a review November 27, 2024 19:57
@@ -106,6 +106,12 @@ func (b *Builder) dockerCLIBuild(ctx context.Context, out io.Writer, name string
if err != nil {
return "", fmt.Errorf("unable to evaluate build args: %w", err)
}
for i, cliFlag := range a.CliFlags {

Choose a reason for hiding this comment

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

Is this something that can be moved to where the other cli args are built: https://github.com/GoogleContainerTools/skaffold/blob/main/pkg/skaffold/docker/image.go#L629? I believe that would also add support for the GCB case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: Support TemplatedField for build.artifacts.docker.cliFlags
2 participants