bottlerocket-os / bottlerocket-os/bottlerocket

buildkit's rootless mode doesn't work on Bottlerocket

Open
#1,934 6 comments 1 reaction 1 assignee Claimed by @bcressey View on GitHub
area/core status/icebox type/bug
Dominant language
Rust
Stars
9.7k
Forks
586
Avg merge
1d 11h
Merged PRs (30d)
11

Description

**Image I'm using:**
aws-k8s-1.21 1.6.0

**What I expected to happen:**
I deployed ["rootless" buildkit](https://github.com/moby/buildkit/blob/master/examples/kubernetes/statefulset.rootless.yaml) and then ran these steps after enabling user namespaces on the node.

```
kubectl exec -it statefulset/buildkitd -- /bin/sh
cd /tmp
cat <Dockerfile
FROM amazonlinux:2
RUN echo hi
EOF
buildctl --addr unix:///run/user/1000/buildkit/buildkitd.sock build --frontend=dockerfile.v0 --local context=. --local dockerfile=. --output type=image,name=test-image,push=false
```

I expected the build to work correctly.

**What actually happened:**
The build failed with an error like this:
```
failed to solve: failed to read dockerfile: failed to mount /home/user/.local/tmp/buildkit-mount313966645: [{Type:bind Source:/home/user/.local/share/buildkit/runc-native/snapshots/snapshots/1 Options:[rbind ro]}]: operation not permitted.
```

**How to reproduce the problem:**
See above.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.