地面站终端 App
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
2.6 KiB

User Guide and DevGuide source migration to Stable v4_3 (#10882) * User guide migration to QGC source * Add google analytics - but need [GA4] Find your Google tag ID * Update (most) notes to use vitepress note syntax * Convert remaining notes, tips, warnings * Prettier all the files * Lower case and compress all images * Lower case filenames * docs_deploy1 * Disable platform builds on commit to docs (only) * Test deployment script 1 (#10893) * docs_deploy1 * Disable platform builds on commit to docs (only) * docs_deploy2 * lower case waypoint file * Lower case console.jpg * Add duplicate index as fallback * Get path from process * fix upload * Disable running workflows for changes in the actions * Attempt update via github workflow * Attempt workflow update * A bit more deployment debugging * MOdify yaml to use personal access token * Lower case the support.md * Fix up pattern * Add UI design - ignored by github * Fix up plugins name * Fix up toolbar * Fix up the Support path * Fix up support link to go to the NEW target * Only build this on commit * Add docs stablev4 3 (#10894) * docs_deploy1 * Disable platform builds on commit to docs (only) * docs_deploy2 * lower case waypoint file * Lower case console.jpg * Add duplicate index as fallback * Get path from process * fix upload * Disable running workflows for changes in the actions * Attempt update via github workflow * Attempt workflow update * A bit more deployment debugging * MOdify yaml to use personal access token * Lower case the support.md * Fix up pattern * Add UI design - ignored by github * Fix up plugins name * Fix up toolbar * Fix up the Support path * Fix up support link to go to the NEW target * Only build this on commit * Remove unused files
1 year ago
# Building using Containers
The community created a docker image that makes it much easier to build a Linux-based QGC application. This can give you a massive boost in productivity and help with testing.
## About the Container
The Container is located in the `./deploy/docker` directory. It's based on ubuntu 20.04. It pre-installs all the dependencies at build time, including Qt, thanks to a script located in the same directory, `install-qt-linux.sh`. The main advantage of using the container is the usage of the `CMake` build system and its many improvements over `qmake`
## Building the Container
Before using the container, you have to build the image. You can accomplish this using docker, running the following script from the root of the QGC source code directory.
```
docker build --file ./deploy/docker/Dockerfile-build-linux -t qgc-linux-docker .
```
::: info
The `-t` flag is essential. Keep in mind this is tagging the image for later reference since you can have multiple builds of the same container
:::
::: info
If building on a Mac computer with an M1 chip you must also specify the build option `--platform linux/x86_64` as shown:
```
docker build --platform linux/x86_64 --file ./deploy/docker/Dockerfile-build-linux -t qgc-linux-docker .
```
Otherwise you will get a build error like:
```
qemu-x86_64: Could not open '/lib64/ld-linux-x86-64.so.2': No such file or directory
```
:::
## Building QGC using the Container
To use the container to build QGC, you first need to define a directory to save the artifacts. We recommend you create a `build` directory on the source tree and then run the docker image using the tag provided above as follows, from the root directory:
```
mkdir build
docker run --rm -v ${PWD}:/project/source -v ${PWD}/build:/project/build qgc-linux-docker
```
::: info
If using the script to build the Linux image on a Windows host, you would need to reference the PWD differently. On Windows the docker command is:
```
docker run --rm -v %cd%:/project/source -v %cd%/build:/project/build qgc-linux-docker
```
:::
Depending on your system resources, or the resources assigned to your Docker Daemon, the build step can take some time.
## Troubleshooting
### Windows: 'bash\r': No such file or directory
This error indicates that a Linux script is being run with Windows line endings, which might occur if `git` was configured to use Windows line endings:
```
> [4/7] RUN /tmp/qt/install-qt-linux.sh:
#9 0.445 /usr/bin/env: 'bash\r': No such file or directory
```
One fix is to force Linux line endings using the command:
```
git config --global core.autocrlf false
```
Then update/recreate your local repository.