-
Notifications
You must be signed in to change notification settings - Fork 164
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
Docker build inside sysbox container results in "Error processing tar file(exit status 1): operation not permitted" #254
Comments
Debugging this, I can see that the inner Docker build fails due to a tar operation that gets an EPERM on the following syscall:
In other words, it appears the Linux kernel is not allowing non-root programs to set the For now the work-around is to use an inner Dockerd whose version is >= 19.03. However a proper fix is needed in Sysbox because I hit a similar error recently when running Podman inside a sysbox container (experimentally) and trying to run an inner container based on a Ubuntu image too. |
@pwurbs reports that a similar error also occurs when the inner Docker is (the following text is copied from issue #380): "I started successfully a pod with docker:dind image (docker:19.03.15-dind-alpine3.13) This is the Docker version info from within the container: Server: Docker Engine - Community These versions are a bit different from your ubuntu-bionic-systemd-docker image. |
Hi @pwurbs, Interesting that you hit this when the inner Docker uses Could you retry with a docker dind image using Docker 20+ please? Thanks! |
Hi @ctalledo, |
Hi @pwurbs, Thanks again. I tried to reproduce this on my Ubuntu-Focal development machine and was not able to. Here are the steps I used:
I'll try now from within a sysbox-powered pod. |
I was able to repro the problem when deploying the docker-dind and docker-cli containers in a Kubernetes cluster, as follows:
apiVersion: v1
kind: Pod
metadata:
name: dind-pod
annotations:
io.kubernetes.cri-o.userns-mode: "auto:size=65536"
spec:
runtimeClassName: sysbox-runc
containers:
- name: dind
image: docker:19.03.15-dind-alpine3.13
command: ["sh", "-c", "dockerd -H tcp://0.0.0.0:2375 > /var/log/dockerd.log 2>&1"]
ports:
- containerPort: 2375
restartPolicy: Never
apiVersion: v1
kind: Pod
metadata:
name: docker-cli-pod
spec:
containers:
- name: docker-cli
image: docker:latest
command: ["sh", "-c", "sleep infinity"]
restartPolicy: Never
A couple of interesting data points:
I'll dig a bit deeper to see what's going on ... |
Stracing the The strace shows:
Process 29601 is I need to understand why the kernel returns EPERM when a process inside the Sysbox container tries to do a setxattr of |
I investigated and it looks like the Thus, solving this issue will require that Sysbox perform syscall trapping of the *xattr() family of syscalls, at a minimum when these operate on the I'm half-way through implementing this solution, expect to have it sometime this week. |
Update: was able to fix the The fix is in my local branch, and took a bit longer to implement than expected. If no further hiccups are found, expect to commit fix early next week. |
These tests verify that sysbox performs syscall interception of the *xattr() syscalls correctly, particularly to enable sys container processes to set the 'trusted.overlay.opaque' extended attribute. See Sysbox issue #254 for more info on why this is necessary. Signed-off-by: Cesar Talledo <ctalledo@nestybox.com>
Quick update: I've uploaded the PRs for the fix, expect to commit Wednesday or Thursday this week. |
These tests verify that sysbox performs syscall interception of the *xattr() syscalls correctly, particularly to enable sys container processes to set the 'trusted.overlay.opaque' extended attribute. See Sysbox issue #254 for more info on why this is necessary. Signed-off-by: Cesar Talledo <ctalledo@nestybox.com>
These tests verify that sysbox performs syscall interception of the *xattr() syscalls correctly, particularly to enable sys container processes to set the 'trusted.overlay.opaque' extended attribute. See Sysbox issue #254 for more info on why this is necessary. Signed-off-by: Cesar Talledo <ctalledo@nestybox.com>
These tests verify that sysbox performs syscall interception of the *xattr() syscalls correctly, particularly to enable sys container processes to set the 'trusted.overlay.opaque' extended attribute. See Sysbox issue #254 for more info on why this is necessary. Signed-off-by: Cesar Talledo <ctalledo@nestybox.com>
PR was merged, issue is now fixed in Sysbox upstream. Will be present in the next Sysbox release (i.e., after v0.4.0). We will also update the sysbox-deploy-k8s daemonset to include the fix shortly. I will post an update here once that is done. |
When running Docker inside a sysbox container, a docker build may fail as follows:
The sysbox container in this case was based on the
docker:18.04-dind
image (i.e., dockerd 18.04 runs inside the sysbox container).In addition, the error occurred when building a Dockerfile that started with the ubuntu 18.04 base image (e.g., "FROM ubuntu:18.04"). The error was not seen when using other base images (e.g., alpine).
The error does not reproduce when using dockerd >= 19.03 inside the sysbox container.
Sysbox version was 0.3.0.
The text was updated successfully, but these errors were encountered: