Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker: Error response from daemon: OCI runtime create failed: container_linux.go:296:

I am trying to run a simple node application with express but I get this error:

enter image description here

Here's my working directory:

enter image description here

I ran the following command to mount my current source code directory to /var/www inside the node container and run node npm start to start up the app; but I get the error above and not sure what to do:

docker run -p 8085:3000 -v /home/joel/workspace/plural_docker_webdev:/var/www node -w "/var/www" node npm start

And I get this error:

docker: Error response from daemon: OCI runtime create failed: container_linux.go:296: starting container process caused "exec: \"-w\": executable file not found in $PATH": unknown.
ERRO[0000] error waiting for container: context canceled
like image 419
pelican Avatar asked Dec 14 '17 15:12

pelican


2 Answers

Docker is telling you that the command hit an error. It is trying to run the node image with the command -w. Since -w is not a command, it throws this error.

This is because you have written node in a place you probably didn't mean to.

Your command is being interpreted like this:

docker run -p [port_info] -v [volume_info] node [command]

You can rewrite your command like so and it should work fine:

docker run -p 8085:3000 -v /home/joel/workspace/plural_docker_webdev:/var/www -w "/var/www" node npm start
like image 88
Ryan Rapp Avatar answered Oct 10 '22 21:10

Ryan Rapp


I had the same issue. My problem was that we did not give it enough memory. Went with the recommended minimum of 2GB of memory. turns out other resources were consuming most of it. gave it 4GB, rebooted & it works fine now.

like image 2
Ricky Avatar answered Oct 10 '22 20:10

Ricky