Skip to content

Commit

Permalink
fix docker build under windows
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanLut committed Jun 6, 2021
1 parent 2fcb1cb commit b5734a3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
Makefile text
*.bat eol=crlf
*.txt text
*.sh text
*.sh text eol=lf
4 changes: 3 additions & 1 deletion docs/development/Building in Docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ Where `<TARGET>` 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 <PATH_TO_REPO>:/src inav-build <TARGET>`
2. `docker run --rm -it -u root -v <PATH_TO_REPO>:/src inav-build <TARGET>`
+ 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.
+ 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.

0 comments on commit b5734a3

Please sign in to comment.