From b5734a3a46fd4685c163c4f10147f6f1f6b1a0bb Mon Sep 17 00:00:00 2001 From: Roman Lut <11955117+RomanLut@users.noreply.github.com> Date: Sun, 6 Jun 2021 22:44:22 +0300 Subject: [PATCH] fix docker build under windows --- .gitattributes | 2 +- docs/development/Building in Docker.md | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitattributes b/.gitattributes index 0ec73feee..4c0973540 100644 --- a/.gitattributes +++ b/.gitattributes @@ -10,4 +10,4 @@ Makefile text *.bat eol=crlf *.txt text -*.sh text +*.sh text eol=lf diff --git a/docs/development/Building in Docker.md b/docs/development/Building in Docker.md index 7e370cf91..99a8784e6 100755 --- a/docs/development/Building in Docker.md +++ b/docs/development/Building in Docker.md @@ -23,12 +23,14 @@ Where `` must be replaced with the name of the target that you want to b ## Windows 10 Docker on Windows requires full paths for mounting volumes in `docker run` commands. For example: `c:\Users\pspyc\Documents\Projects\inav` becomes `//c/Users/pspyc/Documents/Projects/inav` . +If you are getting error "standard_init_linux.go:219: exec user process caused: no such file or directory", make sure `\cmake\docker.sh` has lf (not crlf) line endings. You'll have to manually execute the same steps that the build script does: 1. `docker build -t inav-build .` + This step is only needed the first time. -2. `docker run --rm -it -v :/src inav-build ` +2. `docker run --rm -it -u root -v :/src inav-build ` + Where `` must be replaced with the absolute path of where you cloned this repo (see above), and `` with the name of the target that you want to build. + + Note that on Windows/WSL 2 mounted /src folder is writeable for root user only. You have to run build under root user. You can achieve this by using `-u root` option in the command line above, or by removing "USER inav" line from the .\DockerFile before building image. Refer to the [Linux](#Linux) instructions or the [build script](/build.sh) for more details. \ No newline at end of file