10BC0 [27.x backport] Use the roundtripper during build by rumpl · Pull Request #49194 · moby/moby · GitHub
[go: up one dir, main page]

Skip to content

Conversation

rumpl
Copy link
Member
@rumpl rumpl commented Jan 2, 2025

Backport


- What I did
Added the roundtripper to the containerd worker source manager.

The roundtripper is responsible for giving back the build context when it comes from a tar directly. So we add it to the source manager of the containerd worker.

fixes #47717

- How I did it

- How to verify it

With the sample reproducer from #47717

You can also try this terraform:

terraform {
  required_providers {
    docker = {
      source  = "kreuzwerker/docker"
      version = "~> 3.0.2"
    }
  }
}

provider "docker" {
  host = "unix:///tmp/docker.sock"
}

resource "docker_image" "my-image" {
  name = "my-image:latest"

  build {
    context = "${path.cwd}"
  }
}

Output of the apply:

terraform apply
docker_image.my-image: Refreshing state... [id=sha256:09fe4d17ab2ba82f9e3edb4355216f312a36d58ecf2510271bb225faee0b6329my-image:latest]

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # docker_image.my-image will be created
  + resource "docker_image" "my-image" {
      + id          = (known after apply)
      + image_id    = (known after apply)
      + name        = "my-image:latest"
      + repo_digest = (known after apply)

      + build {
          + cache_from     = []
          + context        = "/home/rumpl/tftest"
          + dockerfile     = "Dockerfile"
          + extra_hosts    = []
          + remove         = true
          + security_opt   = []
          + tag            = []
            # (11 unchanged attributes hidden)
        }
    }

Plan: 1 to add, 0 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

docker_image.my-image: Creating...
docker_image.my-image: Creation complete after 3s [id=sha256:76c0301c79d56873b8aebf2442bd93e78f53fb9b95700448497ef68b20136fdcmy-image:latest]

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.docker -c local images
REPOSITORY   TAG       IMAGE ID       CREATED          SIZE
my-image     latest    76c0301c79d5   11 seconds ago   6.57MB

- Description for the changelog

containerd image store: Fix passing a build context via tarball to the `/build` endpoint.

- A picture of a cute animal (not mandatory but encouraged)

The roundtripper is responsible for giving back the build context when
it comes from a tar directly. So we add it to the source manager of the
containerd worker.

Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
@rumpl rumpl requested a review from tonistiigi as a code owner January 2, 2025 09:11
@rumpl rumpl changed the title Use the roundtripper during build [27.x backport] Use the roundtripper during build Jan 2, 2025
@thaJeztah thaJeztah added area/api API area/builder Build status/2-code-review kind/bugfix PR's that fix bugs containerd-integration Issues and PRs related to containerd integration labels Jan 2, 2025
@thaJeztah thaJeztah modified the milestones: 28.0.0, 27.5.0 Jan 2, 2025
Copy link
Member
@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM

@thaJeztah thaJeztah merged commit 43fc912 into moby:27.x Jan 3, 2025
149 of 150 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api API area/builder Build containerd-integration Issues and PRs related to containerd integration kind/bugfix PR's that fix bugs status/2-code-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0