apple / apple/container

[Bug]: `container build` fails with buildkit permissions issue

Open
#1,906 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
Swift
Stars
49.9k
Forks
1.8k
Avg merge
1d 20h
Merged PRs (30d)
22

Description

### I have done the following

- [x] I have searched the existing issues
- [ ] If possible, I've reproduced the issue using the 'main' branch of this project

### Steps to reproduce

The following minimal reproduction fails to build an extremely basic dockerfile:

```
$ mkdir -p /tmp/container-build-repro
cat > /tmp/container-build-repro/Dockerfile <<'EOF'
FROM debian:bookworm-slim
RUN echo hi
EOF
container build --no-cache -t container-build-repro-test /tmp/container-build-repro

[+] Building 0.1s (5/5) FINISHED
=> [resolver] fetching image...docker.io/library/debian:bookworm-sl 0.0s
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 73B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> oci-layout://docker.io/library/debian:bookworm-slim@sha256:60eac 0.0s
=> => resolve docker.io/library/debian:bookworm-slim@sha256:60eac75 0.0s
=> => extracting sha256:74f1dcfcc9c80045f6f6394ffcfc261cb19d0c71b97 0.0s
=> ERROR [linux/arm64 1/2] RUN echo hi 0.0s
------
> [linux/arm64 1/2] RUN echo hi:
------
Error: unknown: "failed to solve: failed to compute cache key: failed to unmount /tmp/containerd-mount3485907331: operation not permitted: failed to mount /tmp/containerd-mount3485907331: mount source: "/var/lib/buildkit/runc-native/snapshots/snapshots/11", target: "/tmp/containerd-mount3485907331", fstype: bind, flags: 20480, data: "", err: operation not permitted"
```

### Problem description

I think the error seems to be some kind of internal buildkit state being corrupted. I have tried to stop / start the container system and continue, no joy.

I don't think it ever has worked for me on this machine, so it could be a configuration issue. Happy to try and/or share whatever could aid in debugging & diagnosis.

### Environment

```markdown
- OS: macOS 26.5.1 25F80
- Xcode: (none, just command line tools)
- Container: 1.0.0
```

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

Contributor guide

Open the contributing guide

Research direction

Start by running the reported `container build --no-cache` command against `/tmp/container-build-repro/Dockerfile` on the listed macOS and Container 1.0.0 environment. Inspect the BuildKit mount and permissions failure shown in the output; done means the minimal Debian Dockerfile builds successfully without the unmount error.

Written by the indexing model from the issue text.

Assessment

Tech stack
dockerfile
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.