0

I am trying to reproduce steps to create an Ubuntu based image + nginx, described there: https://www.howtoforge.com/tutorial/how-to-create-docker-images-with-dockerfile/

My host machine is Windows. The image is built, then I have created d:\webroot folder on host, index.html file inside and try to run

docker run  -v /d/webroot:/var/www/html -p 80:80 --name doom nginx_image

standard_init_linux.go:211: exec user process caused "no such file or directory"

What may be the reason and how to fix it?

SiHa
  • 7,830
  • 13
  • 34
  • 43
ZedZip
  • 5,794
  • 15
  • 66
  • 119
  • Are you running this on windows machine? – nitishagar Apr 22 '20 at 06:10
  • Yes, my host is Windows – ZedZip Apr 22 '20 at 06:21
  • Can you try using `d:/webroot:/var/www/html` in your docker command above? And see if that works. – nitishagar Apr 22 '20 at 06:27
  • # docker run -v d:/webroot:/var/www/html -p 80:80 --name doom nginx_image docker: Error response from daemon: invalid mode: /var/www/html. – ZedZip Apr 22 '20 at 06:32
  • The drive mount doesn't look like the issue. Your original format seems fine (`/d/webroot:/var/www/html`). Can you check this for your `start.sh` script: https://stackoverflow.com/questions/51508150/standard-init-linux-go190-exec-user-process-caused-no-such-file-or-directory – nitishagar Apr 22 '20 at 06:40
  • 1
    Thnx. Add your comment as an answer. I will mark it. – ZedZip Apr 22 '20 at 07:19

1 Answers1

1

The issue is with the start.sh script which is loaded from Windows. Excerpt below:

#!/bin/sh

/usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf

You need to change the change line ending from CRLF to LF for the start.sh.

And then run: docker run -v /d/webroot:/var/www/html -p 80:80 --name doom nginx_image

nitishagar
  • 9,038
  • 3
  • 28
  • 40