
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
Designed to build and run a debian-based Docker container with LAVA pre-installed and pre-configured.
Note: At this time, running LAVA in Docker is not formally supported by Linaro or the LAVA team, but the team is exploring the ease of use that docker and containers enable.
It may be desired to edit the Dockerfile. This requires locally rebuilding the Docker Image. To build an image locally, execute the following from the directory you cloned the repo:
sudo docker build -t lavadev .
Where lavadev is the Docker image name and can be chosen at the time of build.
To run the image from a host terminal / command line execute the following:
sudo docker run -it -v /boot:/boot -v /lib/modules:/lib/modules -v $PWD/fileshare:/opt/fileshare -v /dev/bus/usb:/dev/bus/usb -v /PATH/TO/id_rsa_lava.pub:/home/lava/.ssh/authorized_keys:ro --device=/dev/ttyUSB0 -p 8000:80 -p 2022:22 -h <HOSTNAME> --privileged lavadev
Where HOSTNAME is the hostname used during the container build process (check the docker build log), as that is the name used for the lava-slave. You can use lava-docker as the pre-built container hostname.
In the above command:
-v /boot:/boot and -v /lib/modules:/lib/modules is neccessary due to libguestfs requireing a kernel and modules before it will run-v $PWD/fileshare:/opt/fileshare Includes a shared directory volume between the container and the host OS (./fileshare). Thus when invoking the docker run command, it should be done from a directory with ./fileshare in it.-v /dev/bus/usb:/dev/bus/usb opens up the USB ports so that fastboot can be connected to a physical target through USB.-v /PATH/TO/id_rsa_lava.pub:/home/lava/.ssh/authorized_keys:ro mounts a host file as a data volume (read-only) to allow remote SSH access. Note that the path to the SSH public key should be adjusted as appropriate.--device=/dev/ttyUSB0 associates the physical serial USB debug port so that a console can be accessed from the container command line using the pre-installed "screen" utility. Note that ttyUSB0 can change from host to host.
shellscreen /dev/ttyUSB0 115200 // to exit screen type `<ctl-a> <ctl-d>`
-p 8000:80 Opens up a network port to the host network so that the user can access the LAVA UI from a browser on another computer on the network <host network IP address>:8000-p 2022:22 opens up a ssh port 2022 for access from other hosts on the network to the container. The user is "lava" and SSH key is used for the credential. Example: ssh -p 2022 lava@<ip address of LAVA container host> -i /path/to/id_rsa_lava. This is mapped to 2022 for the use case where the host is already running SSH server with the default port of 22 to prevent a conflict. SSH is not enabled by default, edit Dockerfile and enable if needed (avoid security issues).-h lava-docker -- with v2, LAVA needs to know the name of the worker machine to submit jobs to devices on that machinelavadev that was defined at build time. This dockerfile is also built and stored on https://hub.docker.com/r/akbennett/lava-docker as akbennett/lava-docker.A script is included in the image to verify that the install was successful. It will kick off several QEMU tests within LAVA. Once kicked off from the command line, progress of the tests can also be monitored from the LAVA web user interface. To execute this command from the container command line, enter /submittestjob.sh. Point your browser to https://localhost:8000/scheduler/alljobs to view the job status.
You can also use the submit python helpers to submit test jobs to the running container. To submit jobs from your host machine you first need to extract the LAVA api key that was defined when building the container, then just use the same scripts that are available in this repository.
Extract the LAVA api key:
sudo docker run lavadev cat /apikey.txt ss1c4huo3qw9mqnysm367buth09yuqwkohfd3hct0f62dwstmggpdexg1hrrwck5w0g1oxo3nqnx0ny6n38b1uxeo4s8ii6gz1jiles3zhjo1qiyyr0qzqk51prt7sb7
Submit a custom job from your host machine:
echo ss1c4huo3qw9mqnysm367buth09yuqwkohfd3hct0f62dwstmggpdexg1hrrwck5w0g1oxo3nqnx0ny6n38b1uxeo4s8ii6gz1jiles3zhjo1qiyyr0qzqk51prt7sb7 > apikey.txt ./submit.py -k apikey.txt --port 8000 kvm-qemu-aarch64.json ./submityaml.py -k apikey.txt --port 8000 -p qemu.yaml
Edit the Dockerfile to execute the lava-server and output the log files by default (CMD /start.sh && tail -f /var/log/lava-*/*), and detach the running container:
sudo docker run -d -v /boot:/boot -v /lib/modules:/lib/modules -v $PWD/fileshare:/opt/fileshare -v /dev/bus/usb:/dev/bus/usb -v /PATH/TO/id_rsa_lava.pub:/home/lava/.ssh/authorized_keys:ro --device=/dev/ttyUSB0 -p 8000:80 -p 2022:22 -h lava-docker --privileged lavadev
To access the LAVA service log files just run docker logs:
sudo docker logs -f lavadev
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务