moby: rootless docker in kubernetes: "getting the final child's pid from pipe caused \"EOF\"": unknown"
I am trying to run rootless docker-in-docker deployed on Kubernetes, where the docker daemon is deployed using this manifest:
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
run: rootless
name: rootless
spec:
replicas: 1
selector:
matchLabels:
run: rootless
template:
metadata:
labels:
run: rootless
spec:
containers:
- image: docker:19.03.1-dind-rootless
name: rootless
command:
- sh
- -c
- dockerd-entrypoint.sh --experimental --storage-driver=vfs
securityContext:
runAsUser: 1000
allowPrivilegeEscalation: true
privileged: true
resources: {}
status: {}
The daemon seems to start up fine but kubectl exec
โing into the pod, setting the DOCKER_HOST and attempting to run a container seems to break
kubctl create -f rootless.yml
kubectl exec -it rootless-7c94dcc5d7-gplvm sh
/ $ export DOCKER_HOST=unix:///run/user/1000/docker.sock
/ $ docker run --rm -it busybox sh
docker: Error response from daemon: OCI runtime create failed: container_linux.go:345: starting container process caused "process_linux.go:303: getting the final child's pid from pipe caused \"EOF\"": unknown.
/ $ command terminated with exit code 125
The dockerd daemon logs are collected in this gist
https://gist.github.com/lukasheinrich/e23c00240afed83066978dab8c354f52#file-logs
kubectl version
gives
Client Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.3", GitCommit:"5e53fd6bc17c0dec8434817e69b04a25d8ae0ff0", GitTreeState:"archive", BuildDate:"2019-06-18T20:40:14Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"12", GitVersion:"v1.12.3", GitCommit:"435f92c719f279a3a67808c80521ea17d5715c66", GitTreeState:"clean", BuildDate:"2018-11-26T12:46:57Z", GoVersion:"go1.10.4", Compiler:"gc", Platform:"linux/amd64"}
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 7
- Comments: 41 (22 by maintainers)
Great thread, thanks @GreeFine & all. Have the same need (rootless dind on k8s) and solved the issue for me as well.
In summary: Preparation
Dockerfile
build & push.
k8s configuration as per above, personally feeling more comfortable with
@AkihiroSuda working for me with the last build of crun ! Kubernetes DinD Rootless ๐
The working crun version:
I just did but this is what he shows me when trying to run some container:
Tried to run this command:
Edit: Nevermind, I had to
chmod +x /usr/local/bin/crun
Can you open an issue at https://github.com/containers/crun/issues for crun issue
yes, containers/crun@ac173ad2c6d752814e4b7970612c24dc2db35117 works
Not likely, sorry.
Maybe --runtime=crun works or prints more helpful error?