Skip to content

docker run with bind mount: stat /bin/bash: no such file or directory: unknown #3378

@oleksiys

Description

@oleksiys

Environment:

Minikube version: v0.30.0

  • OS: MacOS 10.14.1 (18B75)
  • VM Driver: virtualbox
  • ISO version: minikube-v0.30.0.iso

What happened:
I had a problem deploying CSI driver pod on minikube and was able to trace it down to a simple usecase. When I try to deploy this in minikube's docker:

$ docker run --name alpine -d -v /var/lib/kubelet/pods:/var/lib/kubelet/pods:rshared alpine:latest /bin/bash

The result docker returns is:

docker: Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "exec: \"/bin/bash\": stat /bin/bash: no such file or directory": unknown.

After that docker is no longer responsible via unix:///var/run/docker.sock:

docker ps
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

Even though I can still reach it via http:

docker ps -a                                                                                                                                                                                            
CONTAINER ID        IMAGE                                     COMMAND                  CREATED             STATUS              PORTS               NAMES
fc98acbd6fb4        alpine:latest                             "/bin/bash"              23 minutes ago      Created                                 alpine

As you can see the container I was trying to deploy is still there in "Created" state.

Relevant docker logs are here:

Nov 29 18:40:08 minikube dockerd[2440]: time="2018-11-29T18:40:08Z" level=info msg="shim reaped" id=fc98acbd6fb41a90ffb0f3fbff5e41ecefc1afef9c67549bb7f7cfe021d1404e module="containerd/tasks"
Nov 29 18:40:08 minikube dockerd[2440]: time="2018-11-29T18:40:08.106770534Z" level=error msg="stream copy error: reading from a closed fifo"
Nov 29 18:40:08 minikube dockerd[2440]: time="2018-11-29T18:40:08.106994334Z" level=error msg="stream copy error: reading from a closed fifo"
Nov 29 18:40:08 minikube dockerd[2440]: time="2018-11-29T18:40:08.155131140Z" level=error msg="fc98acbd6fb41a90ffb0f3fbff5e41ecefc1afef9c67549bb7f7cfe021d1404e cleanup: failed to delete container from containerd: no such container"

What you expected to happen:

I'd expect the volume to be mounted without error, or if there's an error I'd expect it to not corrupt VM environment.

How to reproduce it (as minimally and precisely as possible):

docker run --name alpine -d -v /var/lib/kubelet/pods:/var/lib/kubelet/pods:rshared alpine:latest /bin/bash

Metadata

Metadata

Assignees

No one assigned

    Labels

    co/docker-envdocker-env issueshelp wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.lifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.priority/backlogHigher priority than priority/awaiting-more-evidence.r/2019q2Issue was last reviewed 2019q2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions