rofrano / vagrant-docker-provider

Build a docker image that can be used in vagrant as a development environment
Apache License 2.0
102 stars 52 forks source link

/dev/null: operation not permitted error #17

Open kakoni opened 2 years ago

kakoni commented 2 years ago

Hi! Trying this on M1 Mac, docker desktop 4.12.0

Sample vagrant file

  config.vm.hostname = "ubuntu"

  config.vm.provider :docker do |docker, override|
    override.vm.box = nil
    docker.image = "rofrano/vagrant-provider:ubuntu"
    docker.remains_running = true
    docker.has_ssh = true
    docker.privileged = true
    docker.volumes = ["/sys/fs/cgroup:/sys/fs/cgroup:rw"]
    docker.create_args = ["--cgroupns=host"]
  end

  config.vm.provision :docker do |d|
    d.pull_images "redis:6-alpine"
    d.run "redis:6-alpine",
      args: "-d --name redis -p 6379:6379 -v redis:/data"
  end
end

vagrant up -provider docker leads to

docker: Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error reopening /dev/null inside container: open /dev/null: operation not permitted: unknown.

I can vagrant ssh into the box just fine.

rofrano commented 2 years ago

@kakoni I was able to reproduce this problem on my M1 Mac mini and I'm looking into it. I couldn't even run docker hello-world and I got the same error. So something broke with the Docker installation. :(

Update: This happens on my Intel Mac as well so not an M1 issue.

mknet commented 1 year ago

Got the same issue with Docker Desktop 4.15.0.

@kakoni Have you already opened an issue anywhere else? I just found this (old) one: https://github.com/docker/for-mac/issues/5527