mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-13 03:19:58 +03:00
fixed dockerfile and updaed docs
This commit is contained in:
parent
bfdd1231ba
commit
3a98eb3f9c
2 changed files with 15 additions and 10 deletions
12
Dockerfile
12
Dockerfile
|
@ -4,15 +4,19 @@ ARG USER_ID
|
||||||
ARG GROUP_ID
|
ARG GROUP_ID
|
||||||
ENV DEBIAN_FRONTEND noninteractive
|
ENV DEBIAN_FRONTEND noninteractive
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y git cmake make ruby gcc python3 python3-pip gcc-arm-none-eabi ninja-build gdb
|
RUN apt-get update && apt-get install -y git cmake make ruby gcc python3 python3-pip gcc-arm-none-eabi ninja-build
|
||||||
|
|
||||||
|
RUN if [ "$GDB" = "yes" ]; then apt-get install -y gdb; fi
|
||||||
|
|
||||||
RUN pip install pyyaml
|
RUN pip install pyyaml
|
||||||
|
|
||||||
# if either of these are already set the same as the user's machine, leave them be and ignore the error
|
# if either of these are already set the same as the user's machine, leave them be and ignore the error
|
||||||
RUN if [ -n "$USER_ID" ]; then RUN addgroup --gid $GROUP_ID inav; exit 0; fi
|
RUN addgroup --gid $GROUP_ID inav; exit 0;
|
||||||
RUN if [ -n "$USER_ID" ]; then RUN adduser --disabled-password --gecos '' --uid $USER_ID --gid $GROUP_ID inav; exit 0; fi
|
RUN adduser --disabled-password --gecos '' --uid $USER_ID --gid $GROUP_ID inav; exit 0;
|
||||||
|
|
||||||
|
ARG INAV_IMAGE_USER=inav
|
||||||
|
USER $INAV_IMAGE_USER
|
||||||
|
|
||||||
RUN if [ -n "$USER_ID" ]; then USER inav; fi
|
|
||||||
RUN git config --global --add safe.directory /src
|
RUN git config --global --add safe.directory /src
|
||||||
|
|
||||||
VOLUME /src
|
VOLUME /src
|
||||||
|
|
|
@ -33,23 +33,24 @@ If you are getting error "standard_init_linux.go:219: exec user process caused:
|
||||||
|
|
||||||
You'll have to manually execute the same steps that the build script does:
|
You'll have to manually execute the same steps that the build script does:
|
||||||
|
|
||||||
1. `docker build -t inav-build .`
|
1. `docker build --build-arg INAV_IMAGE_USER=root -t inav-build .`
|
||||||
+ This step is only needed the first time.
|
+ This step is only needed the first time.
|
||||||
2. `docker run --rm -it -u root -v <PATH_TO_REPO>:/src inav-build <TARGET>`
|
+ Note that on Windows/WSL 2 mounted /src folder is writeable for root user only. You have to run build under root user. This is achieved with `--build-arg INAV_IMAGE_USER=root` option in the command line above.
|
||||||
|
+ If GDB should be installed in the image, add argument '--build-arg GDB=yes'
|
||||||
|
2. `docker run --rm -it -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.
|
+ 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.
|
|
||||||
|
|
||||||
3. If you need to update `Settings.md`, run:
|
3. If you need to update `Settings.md`, run:
|
||||||
|
|
||||||
`docker run --entrypoint /src/cmake/docker_docs.sh --rm -it -u root -v <PATH_TO_REPO>:/src inav-build`
|
`docker run --entrypoint /src/cmake/docker_docs.sh --rm -it -v <PATH_TO_REPO>:/src inav-build`
|
||||||
|
|
||||||
4. Building SITL:
|
4. Building SITL:
|
||||||
|
|
||||||
`docker run --rm --entrypoint /src/cmake/docker_build_sitl.sh -it -u root -v <PATH_TO_REPO>:/src inav-build`
|
`docker run --rm --entrypoint /src/cmake/docker_build_sitl.sh -it -v <PATH_TO_REPO>:/src inav-build`
|
||||||
|
|
||||||
5. Running SITL:
|
5. Running SITL:
|
||||||
|
|
||||||
`docker run -p 5760:5760 -p 5761:5761 -p 5762:5762 -p 5763:5763 -p 5764:5764 -p 5765:5765 -p 5766:5766 -p 5767:5767 --entrypoint /src/cmake/docker_run_sitl.sh --rm -it -u root -v <PATH_TO_REPO>:/src inav-build`.
|
`docker run -p 5760:5760 -p 5761:5761 -p 5762:5762 -p 5763:5763 -p 5764:5764 -p 5765:5765 -p 5766:5766 -p 5767:5767 --entrypoint /src/cmake/docker_run_sitl.sh --rm -it -v <PATH_TO_REPO>:/src inav-build`.
|
||||||
+ SITL command line parameters can be adjusted in `cmake/docker_run_sitl.sh`.
|
+ SITL command line parameters can be adjusted in `cmake/docker_run_sitl.sh`.
|
||||||
|
|
||||||
Refer to the [Linux](#Linux) instructions or the [build script](/build.sh) for more details.
|
Refer to the [Linux](#Linux) instructions or the [build script](/build.sh) for more details.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue