
如果你使用 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 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
Pre-requisites
cd setup-coreInteractive mode, with logs docker-compose up
Detached mode docker-compose up -d
Logs of all containers (and follow) docker-compose logs -f
Logs of a specific container (and follow) docker-compose logs -f usergrid
Lists containers & their status docker-compose ps
Tear down an environment (Stop and remove containers, networks, images, and volumes)
Leave images & volumes docker-compose down
Leave nothing docker-compose down -rmi -v
There are many ways to achieve this. We use a dedicated logging container. Dedicated logging containers let you manage logging from within the Docker environment. They can retrieve log events from other containers, aggregate them, then store or forward the events to a third-party service.
https://github.com/gliderlabs/logspout
The Logspout container automatically captures stdout output from any containers running on the same host and forwards them to a remote syslog service. You can define the destination URL when running the container:
docker run --name="logspout" \ --volume=/var/run/docker.sock:/var/run/docker.sock \ gliderlabs/logspout \ syslog+tls://logs.papertrailapp.com:55555
As first step use docker stats. The docker stats command is useful for getting information on the command line, however, if you would like to access the information in a graphical interface you will need a tool such as CAdvisor.
https://github.com/google/cadvisor
CAdvisor provides a visual representation of the data shown by the docker stats command earlier. Run the docker command below and go to http://<your-hostname>:8080/ in the browser of your choice to see the CAdvisor interface. You will be shown graphs for overall CPU usage, Memory usage, Network throughput and disk space utilization. You can then drill down into the usage statistics for a specific container by clicking the Docker Containers link at the top of the page and then selecting the container of your choice.
docker run \ --volume=/:/rootfs:ro \ --volume=/var/run:/var/run:rw \ --volume=/sys:/sys:ro \ --volume=/var/lib/docker/:/var/lib/docker:ro \ --publish=8888:8080 \ --detach=true \ --name=cadvisor \ google/cadvisor:latest
cAdvisor supports exporting stats to various storage driver plugins for time-series analytics (elasticsearch, prometheus. To enable a storage driver, set the -storage_driver flag. See https://github.com/google/cadvisor/blob/master/docs/storage/README.md
Instead of using docker-compose, you can use Docker directly. The examples below use the automated builds from the https://hub.docker.com/r/dlsimg/.
Start Cassandra and Elasticsearch:
docker run --detach --name cassandra --volume $(pwd)/cassandra-data:/var/lib/cassandra dlsimg/cassandra docker run --detach --name elasticsearch --volume $(pwd)/elasticsearch-data:/data dlsimg/elasticsearch
Start Usergrid, configuration is done using environment variables (--env).
docker run --detach --name usergrid --env ADMIN_PASS=password --env ORG_NAME=org --env APP_NAME=app --link elasticsearch:elasticsearch --link cassandra:cassandra -p 8080:8080 dlsimg/usergrid
Start the Usergrid admin portal
docker run --detach --name portal --env USERGRID_HOST=usergrid:8080 -p 80:80 dlsimg/usergrid-portal
docker build — The docker build command builds Docker images from a Dockerfile. Use the -t flag to label the image, for example docker build -t my_container . with the . at the end signalling to build using the currently directory.
cd cassandra && build -t cassandra . cd elasticsearch && build -t elasticsearch . cd usergrid\baas && build -t usergrid . cd usergrid\portal && build -t portal .
Docker pull - pulls an image from remote repositository (docker hub by default), for example docker pull dlsimg/base-node:latest.
docker attach will let you connect to your Docker container, but this isn't really the same thing as ssh. If your container is running a webserver, for example, docker attach will probably connect you to the stdout of the web server process. It won't necessarily give you a shell.
docker exec will let you run arbitrary commands inside an existing container. For example: docker exec -it <mycontainer> bash starts an interactive shell. Whatever command (bash in this case) you are running must exist in the container filesystem.
get container IP from host docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' container_name_or_id. Or use exec docker exec -it container_name ip addr
kill all running containers with docker kill $(docker ps -q)
delete all stopped containers with docker rm $(docker ps -a -q)
delete all images with docker rmi $(docker images -q)
Install ugc with gem install ugc. Documentation is https://github.com/apache/incubator-usergrid/tree/master/ugc. For more examples, see the https://github.com/apache/incubator-usergrid/tree/master/ugc#examples.
ugc profile org - create profile with name org. subsequent commands are applied to this profile.ugc target url http://$IP:8080/org/app - use host at $IP, organization called org and app called appugc login --admin $USERNAME@example.com - log in as one of the admins users admin or orgadmin. password is the same as the username.ugc login $USERNAME@example.com - log in as regular user. there is a default user called orguser. password is same as username.ugc list collections - list collections. think of it as tables in a relational database. you can list other things as well.您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务