Closed ghost closed 6 years ago
i have tried reset docker deamon, it not work.
not working even after restart the computer.
looks some symlink removed from /dev, and the mobylinux crashed? so i have to reinstall docker?
same issue, running same version and on Fedora 25 here too.
https://github.com/docker/for-linux/issues is probably a better place to report this issue. I don't believe this is related to the cli.
Isn't this because you try to define the volume twice? This volume is already defined in the nginx docker file.
If I mount the volume on run it works "docker run -d -p 80:80 -v $PWD:/usr/share/nginx/html nginx"
same error, same arm64, same docker version
VOLUME [".","/usr/share/nginx/html"]
@suiwenfeng What exactly are you trying to do with that line? Using the JSON notation for VOLUME
in this case attempts to define two volumes; one at "."
(current working-directory), and one at "/usr/share/nginx/html"
(which is already defined as a volume in the base image)
The first ("."
) is what's causing the issue here, because the working-dir for the nginx
image is /
, which effectively would try to create a volume for the whole container (which isn't allowed / won't work).
You can find the current working-directory for the image using the following;
$ docker run --rm nginx pwd
/
Interesting bit here, is that there is some validation in the daemon, but it's missing validation for certain cases. For example, these Dockerfiles all build without producing an error during build;
FROM nginx
VOLUME ["/"]
FROM nginx
VOLUME /
FROM nginx
VOLUME ["."]
FROM nginx
VOLUME .
But starting a container from any of the above (as expected) won't work;
docker: Error response from daemon: OCI runtime create failed: container_linux.go:296: starting container process caused "process_linux.go:398: container init caused \"open /dev/ptmx: no such file or directory\"": unknown.
When defining a volume at runtime, the following correctly produces a validation error;
$ docker run -it --rm -v myvolume:/ nginx
docker: Error response from daemon: invalid volume specification: 'myvolume:/': invalid mount config for type "volume": invalid specification: destination can't be '/'.
See 'docker run --help'.
But only specifying the "container path" does not perform the correct validation, thus results in the same "cryptic" error;
$ docker run -it --rm -v / nginx
docker: Error response from daemon: OCI runtime create failed: container_linux.go:296: starting container process caused "process_linux.go:398: container init caused \"open /dev/ptmx: no such file or directory\"": unknown.
I opened https://github.com/moby/moby/issues/35879 for tracking this in the Moby repository (where this validation should be performed). Given that this is not a bug in the CLI, and the bug is missing validation for these cases (the Dockerfile is actually incorrect), I'm closing the issue here, but feel free to continue the conversation
Same problem on docker-ce
within jenkins
container, running on Windows 10 host (inception):
docker run -d --name test.nginx -p 90:80 -p 554:443 --network graphityplatform_default --network-alias test.nginx -v /var/jenkins_home/workspace/docker-platform_stage.localhost_/docker/nginx-frontend/nginx.test.conf:/etc/nginx/nginx.conf nginx
docker: Error response from daemon: OCI runtime create failed: container_linux.go:296: starting container process caused "process_linux.go:398: container init caused \"rootfs_linux.go:58: mounting \\\"/var/jenkins_home/workspace/docker-platform_stage.localhost_/docker/nginx-frontend/nginx.test.conf\\\" to rootfs \\\"/var/lib/docker/overlay2/81cb11389790f97d5026133a05e4f555d499963dd614e082072276ca6a362bc6/merged\\\" at \\\"/var/lib/docker/overlay2/81cb11389790f97d5026133a05e4f555d499963dd614e082072276ca6a362bc6/merged/etc/nginx/nginx.conf\\\" caused \\\"not a directory\\\"\"": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type.
def81c6ffdf5f699517b2908d6a96ca40551646c4a965cef2be561c9cffd6433
Any solutions on this error ?
@pumba-lt your error looks different; from the error (copied the important parts below):
mounting "/var/jenkins_home/workspace/docker-platform_stage.localhost_/docker/nginx-frontend/nginx.test.conf" to rootfs
at "/var/lib/docker/overlay2/81cb11389790f97d5026133a05e4f555d499963dd614e082072276ca6a362bc6/merged/etc/nginx/nginx.conf"
caused "not a directory """: unknown:
Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type.
That error indicates that likely the nginx.test.conf
file did not exist on the daemon host. If you were attempting to mount a file using the -v <host-path>:<container-path>
option, and <host-path>
doesn't exist on the daemon host, docker will assume you want to bind-mount a directory, and create the directory if it doesn't exist. It then bind-mounts the directory in the container at <container-path>
, which will fail if <container-path>
is a file (because you cannot mount a directory on top of a file). That's the last part of the error message:
Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type.
/var/jenkins_home/workspace/docker-platform_stage.localhost_/docker/nginx-frontend/nginx.test.conf
exists on the daemon host--mount
flag instead of -v
/ --volume
: the --mount
flag will not automatically create a directory if the host-path is missing, but instead produce an error, so that you're aware the path (file/directory) on the host is missing.Bind-mounting always happens from the host where the daemon runs, so even though the file may be present on your "client" machine; if that machine is a local machine, and not the machine where the daemon runs, bind-mounting won't work.
Also note that if you are running docker-in-docker, the "daemon host" may be the container in which the daemon is running.
@akivanctp the original error reported is an invalid volume path (/
cannot be used as a volume). For other situations, see my comment above: TL;DR make sure that, when using bind-mounts, the path that you're trying to mount exists.
any solution for this issue ? oci runtime error: container_linux.go:265: starting container process caused "exec:
Any solution?? https://hjlabs.in/
same with "Version 2.0.0.0-mac78 (28905)" I've tried reset to factory settings but still got:
docker: Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "exec: \"-d\": executable file not found in $PATH": unknown.
@jakubzloczewski double-check the exact command you're running to start your container; from that output, it looks like you passed the -d
option after the name of the image you're trying to run. Because of that, -d
is used as the command to run inside the container, thus will fail;
docker run busybox -d
docker: Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "exec: \"-d\": executable file not found in $PATH": unknown.
The -d
(--detach
) option is an option for docker run, so must be passed before the name of the image you're running;
docker run -d busybox
I have a similar issue, when I tried to install elasticsearch on my personal laptop, I execute
docker run --name=amp-es -d -v ~/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml -p 9200:9200 -p 9300:9300 --network=amp-network elasticsearch:2.4
then got the same error:
Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "process_linux.go:402: container init caused \"rootfs_linux.go:58: mounting \\\"/Users/cliu426/elasticsearch.yml\\\" to rootfs \\\"/var/lib/docker/overlay2/53adcd81e2c00ea1f7b40ee67b5ae62ae6d80afbb939b57ef48adf37d003f7fd/merged\\\" at \\\"/var/lib/docker/overlay2/53adcd81e2c00ea1f7b40ee67b5ae62ae6d80afbb939b57ef48adf37d003f7fd/merged/usr/share/elasticsearch/config/elasticsearch.yml\\\" caused \\\"not a directory\\\"\"": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type
Error: failed to start containers: amp-es
@Liuchengda Not the same error (cleaned up the error for readability);
mounting "/Users/cliu426/elasticsearch.yml" to rootfs "/var/lib/docker/overlay2/53adcd81e2c00ea1f7b40ee67b5ae62ae6d80afbb939b57ef48adf37d003f7fd/merged"
at "/var/lib/docker/overlay2/53adcd81e2c00ea1f7b40ee67b5ae62ae6d80afbb939b57ef48adf37d003f7fd/merged/usr/share/elasticsearch/config/elasticsearch.yml"
caused "not a directory": unknown:
Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type
That last line is the actual error; you're trying to mount a local file or directory from your host (/Users/cliu426/elasticsearch.yml
) into the container (at /usr/share/elasticsearch/config/elasticsearch.yml
). However, the path on your host cannot be found, or is a directory;
/Users/cliu426/elasticsearch.yml
exists
-v
option; docker creates a directory at the given location if the file/path does not existFor me the error occurred when I was trying to execute command to run my startup script command: bash startup.sh
. Problem was that my image build was made on alpine
linux which uses ash as shell instead of bash. Just double check that you are referring to correct shell interpreter.
It is also may be caused by modified credentials (on Windows). When you have changed your system password, Docker cannot automatically determine it. You should go to Settings\Shared Drives and Reset credentials.
It is also may be caused by modified credentials (on Windows). When you have changed your system password, Docker cannot automatically determine it. You should go to Settings\Shared Drives and Reset credentials.
This actually fixed it for me. Went nuts for a whole afternoon. Thank you!
It is also may be caused by modified credentials (on Windows). When you have changed your system password, Docker cannot automatically determine it. You should go to Settings\Shared Drives and Reset credentials.
This actually fixed it for me. Went nuts for a whole afternoon. Thank you!
Same what happened for me: "This actually fixed it for me. Went nuts for a whole afternoon. Thank you!"
same error here when running Hello-world docker version.. Docker on Fedora 31
[ThaSami@localhost ~]$ docker run hello-world docker: Error response from daemon: OCI runtime create failed: container_linux.go:346: starting container process caused "process_linux.go:297: applying cgroup configuration for process caused \"open /sys/fs/cgroup/docker/cpuset.cpus.effective: no such file or directory\"": unknown. ERRO[0009] error waiting for container: context canceled
@ThaSami current version of Fedora 31 switched to using cgroupsV2 by default, which is not yet supported by the container runtimes (and kubernetes); work is in progress on this, but not yet complete, and not yet production ready. To disable v2 cgroups, run:
sudo grubby --update-kernel=ALL --args="systemd.unified_cgroup_hierarchy=0"
And restart your machine.
I had the same issue on a host running Ubuntu and needed to use:
sudo update-grub "systemd.unified_cgroup_hierarchy=0"
For anyone else that is on Ubuntu so doesn't have grubby
I have this error on windows and I never changed my credentials
@ThaSami current version of Fedora 31 switched to using cgroupsV2 by default, which is not yet supported by the container runtimes (and kubernetes); work is in progress on this, but not yet complete, and not yet production ready. To disable v2 cgroups, run:
sudo grubby --update-kernel=ALL --args="systemd.unified_cgroup_hierarchy=0"
And restart your machine.
Thanks for your fix. I'm on Fedora 31, and docker works with latest docker documentation for fedora: https://docs.docker.com/install/linux/docker-ce/fedora/#install-docker
@ThaSami current version of Fedora 31 switched to using cgroupsV2 by default, which is not yet supported by the container runtimes (and kubernetes); work is in progress on this, but not yet complete, and not yet production ready. To disable v2 cgroups, run:
sudo grubby --update-kernel=ALL --args="systemd.unified_cgroup_hierarchy=0"
And restart your machine.
The solution worked like a charm for Fedora 31.
Getting this on Mac OSX Catalina still.
Getting this on Mac OSX Catalina still.
Any advice or suggest?
Fedora 31
$ sudo grubby --update-kernel=ALL --args="systemd.unified_cgroup_hierarchy=0"
grub2-editenv: error: invalid environment block.
grub2-editenv: error: invalid environment block.
grub2-editenv: error: invalid environment block.
grub2-editenv: error: invalid environment block.
grub2-editenv: error: invalid environment block.
grub2-editenv: error: invalid environment block.
Fedora31 docker also has the issue : ` I already add the systemd.unified_cgroup_hierarchy=0 to grub.
BOOT_IMAGE=/vmlinuz-5.5.8-200.fc31.x86_64 root=/dev/mapper/fedora_localhost--live-root ro resume=/dev/mapper/fedora_localhost--live-swap rd.lvm.lv=fedora_localhost-live/root rd.lvm.lv=fedora_localhost-live/swap modprobe.blacklist=nouveau systemd.unified_cgroup_hierarchy=0
docker: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"xtensa-build-all.sh\": executable file not found in $PATH": unknown.`
I am experiencing the same under Ubuntu 20.04 with zfs on root after a reboot. I have reinstalled docker and cannot get my containers up.
docker: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"/entrypoint.sh\": stat /entrypoint.sh: no such file or directory": unknown.
Same issue `docker info Client: Debug Mode: false Plugins: app: Docker Application (Docker Inc., v0.8.0) buildx: Build with BuildKit (Docker Inc., v0.3.1-tp-docker) mutagen: Synchronize files with Docker Desktop (Docker Inc., testing)
Server:
Containers: 6
Running: 0
Paused: 0
Stopped: 6
Images: 1
Server Version: 19.03.8
Storage Driver: overlay2
Backing Filesystem:
docker run -it centos centos /bin/sh docker: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"centos\": executable file not found in $PATH": unknown.
Had the same issue here on Manjaro 20.0.1 -> Docker version 19.03.8-ce -> Container centos:7
Solved it by doing: chmod+x entrypoint.sh from the host.
I executed this command docker run -it centos
and the error shows up
I executed sudo docker run busybox -it --rm
, it throws back this error:
docker: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"-it\": executable file not found in $PATH": unknown. ERRO[0002] error waiting for container: context canceled
any ideas?
@minaee docker flags should be put before the image name, otherwise they're passed to the container as arguments for the container's main process:
docker run [options] [image name] [arguments for container's process]
So in your case;
sudo docker run -it --rm busybox
@minaee docker flags should be put before the image name, otherwise they're passed to the container as arguments for the container's main process:
docker run [options] [image name] [arguments for container's process]
So in your case;
sudo docker run -it --rm busybox
Oh, yes. Thanks
Hey everyone, what about this error please.
i execute this command "sudo docker run hello-world
" , it gives me this error
<<< docker: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "process_linux.go:449: container init caused \"rootfs_linux.go:58: mounting \\"proc\\" to rootfs \\"/var/lib/docker/overlay2/63492ef766e4b2f1ae17d5b6abc40fc07b910caeb46a570fdd43d25c82694a04/merged\\" at \\"/proc\\" caused \\"permission denied\\"\"": unknown. ERRO[0003] error waiting for container: context canceled >>>
In my case, incorrect volume declaration cause this issue. I had "- ./" in volumes section of docker-compose.yml. Providing actual paths or just removing that entry restores configuration to working order :)
@jakubzloczewski double-check the exact command you're running to start your container; from that output, it looks like you passed the
-d
option after the name of the image you're trying to run. Because of that,-d
is used as the command to run inside the container, thus will fail;docker run busybox -d docker: Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "exec: \"-d\": executable file not found in $PATH": unknown.
The
-d
(--detach
) option is an option for docker run, so must be passed before the name of the image you're running;docker run -d busybox
My goodness you're right, it's because I messed up the arguments position, regardless the error message (or the argument parser) needs improvement, without this thread it's impossible to figure out why.
still getting this, 2 years later and 40+ reactions on macOS catalina, stuff like this makes me doubt the time I save with docker for development.. 🙃
@dkypuros Thanks a lot! This documentation also works for Fedora 32.
sudo update-grub "systemd.unified_cgroup_hierarchy=0"
not helped. @tomwj
ubuntu 20.04:
$ sudo update-grub "systemd.unified_cgroup_hierarchy=0"
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.4.0-53-generic
Found initrd image: /boot/initrd.img-5.4.0-53-generic
Found linux image: /boot/vmlinuz-5.4.0-52-generic
Found initrd image: /boot/initrd.img-5.4.0-52-generic
Found Windows Boot Manager on /dev/sdb1@/efi/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for UEFI Firmware Settings
done
$ docker run --gpus all nvcr.io/nvidia/mxnet:20.10-py3
docker: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "process_linux.go:449: container init caused \"process_linux.go:432: running prestart hook 0 caused \\\"error running hook: exit status 1, stdout: , stderr: nvidia-container-cli: initialization error: nvml error: driver not loaded\\\\n\\\"\"": unknown.
ERRO[0000] error waiting for container: context canceled
sudo update-grub "systemd.unified_cgroup_hierarchy=0"
not helped. @tomwjubuntu 20.04:
$ sudo update-grub "systemd.unified_cgroup_hierarchy=0" Sourcing file `/etc/default/grub' Sourcing file `/etc/default/grub.d/init-select.cfg' Generating grub configuration file ... Found linux image: /boot/vmlinuz-5.4.0-53-generic Found initrd image: /boot/initrd.img-5.4.0-53-generic Found linux image: /boot/vmlinuz-5.4.0-52-generic Found initrd image: /boot/initrd.img-5.4.0-52-generic Found Windows Boot Manager on /dev/sdb1@/efi/Microsoft/Boot/bootmgfw.efi Adding boot menu entry for UEFI Firmware Settings done $ docker run --gpus all nvcr.io/nvidia/mxnet:20.10-py3 docker: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "process_linux.go:449: container init caused \"process_linux.go:432: running prestart hook 0 caused \\\"error running hook: exit status 1, stdout: , stderr: nvidia-container-cli: initialization error: nvml error: driver not loaded\\\\n\\\"\"": unknown. ERRO[0000] error waiting for container: context canceled
Same error on ubuntu 20.04
Debian 10 and following instructions from site. $ sudo docker run hello-world docker: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "process_linux.go:449: container init caused \"rootfs_linux.go:58: mounting \\"proc\\" to rootfs \\"/var/lib/docker/overlay2/85e3fff3dba9f06037ec713e0cb5cfe963b761dfd6edd5c0eed79857dbfc5d66/merged\\" at \\"/proc\\" caused \\"permission denied\\"\"": unknown. ERRO[0000] error waiting for container: context canceled
sudo update-grub "systemd.unified_cgroup_hierarchy=0"
not helped. @tomwj ubuntu 20.04:$ sudo update-grub "systemd.unified_cgroup_hierarchy=0" Sourcing file `/etc/default/grub' Sourcing file `/etc/default/grub.d/init-select.cfg' Generating grub configuration file ... Found linux image: /boot/vmlinuz-5.4.0-53-generic Found initrd image: /boot/initrd.img-5.4.0-53-generic Found linux image: /boot/vmlinuz-5.4.0-52-generic Found initrd image: /boot/initrd.img-5.4.0-52-generic Found Windows Boot Manager on /dev/sdb1@/efi/Microsoft/Boot/bootmgfw.efi Adding boot menu entry for UEFI Firmware Settings done $ docker run --gpus all nvcr.io/nvidia/mxnet:20.10-py3 docker: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "process_linux.go:449: container init caused \"process_linux.go:432: running prestart hook 0 caused \\\"error running hook: exit status 1, stdout: , stderr: nvidia-container-cli: initialization error: nvml error: driver not loaded\\\\n\\\"\"": unknown. ERRO[0000] error waiting for container: context canceled
Same error on ubuntu 20.04
I was copying a directory instead of an executable file in my dockerfile so it was crushing like this. Be careful when you copy stuff in containers.
I fixed such issues in my local.
Error is below: "Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "process_linux.go:449: container init caused \"rootfs_linux.go:58: mounting \\"/(mylocalpath)\\" to rootfs \\"/var/lib/docker/overlay2/830894f27fcb8f3c523234f1da8504dd2dda4424343d71bddeb477b07888061a/merged\\" at \\"/var/lib/docker/overlay2/830894f27fcb8f3c523234f1da8504dd2dda4424343d71bddeb477b07888061a/merged/docker-entrypoint-initdb.d/init.sql\\" caused \\"not a directory\\"\"": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type"
Root Causes: Deleted the mounting path in local which is already connected with my local docker. I was running docker without this file (mylocalpath), hence I got above error.
Resolution: I just recreated the path (mylocalpath) and restarted the docker. Then i could able to start my docker container.
Description
Steps to reproduce the issue:
add config to
copy ./default.conf /etc/nginx/conf.d
VOLUME [".","/usr/share/nginx/html"]
CMD ["nginx", "-g", "daemon off;"]
Docker version 17.06.0-ce, build 02c1d87
Containers: 1 Running: 0 Paused: 0 Stopped: 1 Images: 7 Server Version: 17.06.0-ce Storage Driver: overlay2 Backing Filesystem: extfs Supports d_type: true Native Overlay Diff: true Logging Driver: json-file Cgroup Driver: cgroupfs Plugins: Volume: local Network: bridge host ipvlan macvlan null overlay Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog Swarm: inactive Runtimes: runc Default Runtime: runc Init Binary: docker-init containerd version: cfb82a876ecc11b5ca0977d1733adbe58599088a runc version: 2d41c047c83e09a6d61d464906feb2a2f3c52aa4 init version: 949e6fa Security Options: seccomp Profile: default Kernel Version: 4.9.31-moby Operating System: Alpine Linux v3.5 OSType: linux Architecture: x86_64 CPUs: 4 Total Memory: 1.952GiB Name: moby ID: AX4D:5GVQ:SDCP:PFA2:BJFW:Y3RJ:YYCB:QWV7:UW4B:U5BF:5UJB:CZHF Docker Root Dir: /var/lib/docker Debug Mode (client): false Debug Mode (server): true File Descriptors: 19 Goroutines: 34 System Time: 2017-07-05T08:02:41.906145547Z EventsListeners: 1 No Proxy: *.local, 169.254/16 Registry: https://index.docker.io/v1/ Experimental: true Insecure Registries: 127.0.0.0/8 Live Restore Enabled: false