Skip to content

[Bug]: buildkit container loose sync when tgz archive #1143

Closed
apple/container-builder-shim
#64

Description

@m-emelchenkov

I have done the following

  • I have searched the existing issues
  • If possible, I've reproduced the issue using the 'main' branch of this project

Steps to reproduce

  1. container stop buildkit; container rm buildkit.
  2. cd Tools; ./run.sh.
  3. edit Dockerfile.sh, change "Hello World" to "Hello World 2".
  4. ./run.sh.

After the second run, instead of "Hello World 2" output you'll get "Hello World". This is because fssync breaks in buildkit container. It never updates files anymore. I tried different archives but can't reproduce it nowhere except the one attached.

Interestingly, my superpower is finding bugs, and this is literally the first docker image I've ever built on Apple Containers, and it took me a whole day to figure out the cause and create this bug report.

It's fun that I can't upload archive here, "Failed to upload". So here is a link to Google Driver: https://drive.google.com/file/d/1AzUpGAiK2UETB6YaWnt-TbbpN9V3hee9/view?usp=share_link

Current behavior

Does not sync filesystem inside buildkit container.

Expected behavior

Should work flawlessly like Podman and Docker.

Environment

- OS: Tahoe 26.2
- Xcode: N/A
- Container: 0.8.0

Relevant log output

N/A

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. added theissue type on Feb 3, 2026
  2. jglogan commented on Feb 3, 2026

    @jglogan
    Contributor

    @m-emelchenkov Can you post the contents of a Dockerfile that reproduces this issue, along with the container commands you used?

  3. added a commit that references this issue on Feb 3, 2026
    3edb322
  4. jglogan commented on Feb 3, 2026

    @jglogan
    Contributor

    Also could you try posting a zip archive instead of tgz? If we need to repackage it as tgz, we can do that after downloading.

  5. jglogan commented on Feb 3, 2026

    @jglogan
    Contributor

    @m-emelchenkov this made me smile:

    Interestingly, my superpower is finding bugs

    I've known others with that superpower. It's a very valuable talent!

  6. added a commit that references this issue on Feb 3, 2026
    ae69308
  7. m-emelchenkov commented on Feb 3, 2026

    @m-emelchenkov
    Author

    @m-emelchenkov Can you post the contents of a Dockerfile that reproduces this issue, along with the container commands you used?

    Please download zip from Google Drive link — it's a self-contained example to reproduce the bug.

  8. JaewonHur commented on Feb 3, 2026

    @JaewonHur
    Contributor

    Thanks, let me take a look at it.

  9. JaewonHur commented on Feb 3, 2026

    @JaewonHur
    Contributor

    Hi @m-emelchenkov,
    I just made a PR for fixing this issue. Could you give a try?

    • Build a custom buildkit image
    git clone -b use-tar-hash-as-checksum https://github.com/JaewonHur/container-builder-shim
    cd container-builder-shim
    container build -t builder -f ./Dockerfile
    container kill buildkit
    container rm buildit
    
    • Rebuild container
    container system stop
    git clone -b send-tar-hash https://github.com/JaewonHur/container
    cd container
    make all install
    container system start
    
    • Set custom buildit image as default
    container system property set image.builder builder:latest
    
    • Try your testcase
      ...
  10. m-emelchenkov commented on Feb 4, 2026

    @m-emelchenkov
    Author

    Hi @JaewonHur! Thank you very much for reaching out in a very prompt manner. I have installed the debug branch. It works when editing Dockerfile.sh, though when I add a new file:

    cd ./Tools
    touch cool.file
    [edit Dockerfile and add "COPY cool.file /root" to it right before "WORKDIR" line]
    ./run.sh
    

    I am getting an error:

    #9 [linux/arm64/v8 stage-1 3/5] COPY cool.file /root
    #9 ERROR: failed to calculate checksum of ref cunbz8gtsjeof1ekmio2f58i4::wxnhqk9abuz8zsfyruzak9rx3: "/cool.file": not found
    ------
     > [linux/arm64/v8 stage-1 3/5] COPY cool.file /root:
    ------
    Error: unknown (2): failed to solve: failed to compute cache key: failed to calculate checksum of ref cunbz8gtsjeof1ekmio2f58i4::wxnhqk9abuz8zsfyruzak9rx3: "/cool.file": not found
    Warning! Running debug build. Performance may be degraded.
    
  11. JaewonHur commented on Feb 4, 2026

    @JaewonHur
    Contributor

    Hi @m-emelchenkov,
    Thank you for catching it!

    I just updated to hash the metadata also.
    Could you please git it another try?

  12. m-emelchenkov commented on Feb 4, 2026

    @m-emelchenkov
    Author

    Hi @JaewonHur! I have tested it and I like it. I tested:
    a) changing Dockerfile.sh;
    b) adding file;
    c) adding directory with file.
    All works OK.

    Thanks a lot!!!

    By the way, when to expect this fix in stable branch? I mean, the probable version number? Because I mainly use Homebrew so will await it there.

  13. jglogan commented on Feb 4, 2026

    @jglogan
    Contributor

    Hi @m-emelchenkov, first thank you for catching this!

    The general schedule is to release the last Monday of every month, so 0.10.0 is planned for Feb 23.

    Unless something really odd happens we'll tag a container-builder-shim release once the shim-side fix for this issue is in, and the bump the default builder shim version over here in the container-side PR for the issue, so everything should be running in main today.

  14. added a commit that references this issue on Feb 5, 2026
    fabfc55
  15. added a commit that references this issue on Feb 18, 2026
    61c0378
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions