Skip to content

Commit b5734a3

Browse files
committed
fix docker build under windows
1 parent 2fcb1cb commit b5734a3

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

.gitattributes

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010
Makefile text
1111
*.bat eol=crlf
1212
*.txt text
13-
*.sh text
13+
*.sh text eol=lf

docs/development/Building in Docker.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,14 @@ Where `<TARGET>` must be replaced with the name of the target that you want to b
2323
## Windows 10
2424

2525
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` .
26+
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.
2627

2728
You'll have to manually execute the same steps that the build script does:
2829

2930
1. `docker build -t inav-build .`
3031
+ This step is only needed the first time.
31-
2. `docker run --rm -it -v <PATH_TO_REPO>:/src inav-build <TARGET>`
32+
2. `docker run --rm -it -u root -v <PATH_TO_REPO>:/src inav-build <TARGET>`
3233
+ Where `<PATH_TO_REPO>` must be replaced with the absolute path of where you cloned this repo (see above), and `<TARGET>` with the name of the target that you want to build.
34+
+ 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.
3335

3436
Refer to the [Linux](#Linux) instructions or the [build script](/build.sh) for more details.

0 commit comments

Comments
 (0)