From 56156c3a2e3d04486d67074d6e05c6a76f39cc6c Mon Sep 17 00:00:00 2001 From: hrz <1710360675@qq.com> Date: Thu, 6 Feb 2025 09:33:18 +0800 Subject: [PATCH] =?UTF-8?q?fixed:=E9=83=A8=E5=88=86=E7=BB=88=E7=AB=AF?= =?UTF-8?q?=E8=BF=90=E8=A1=8Cdocker=E8=B5=84=E6=BA=90=E9=99=90=E5=88=B6?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .dockerignore | 10 ++++++++++ README.md | 2 +- README_en.md | 2 +- docs/docker-build.md | 6 ++++-- 4 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..5873f95e --- /dev/null +++ b/.dockerignore @@ -0,0 +1,10 @@ +.git +__pycache__ +*.pyc +.env +Dockerfile +docs/ +tmp/ +LICENSE +README.md +README_en.md \ No newline at end of file diff --git a/README.md b/README.md index 097e5360..1316122e 100644 --- a/README.md +++ b/README.md @@ -118,7 +118,7 @@ dir 如果你能看到`config.yaml`文件,确确实实进入到了`项目目录`,接着执行以下命令: ``` -docker run -d --name xiaozhi-esp32-server --restart always -p 8000:8000 -v ./config.yaml:/opt/xiaozhi-es32-server/config.yaml ccr.ccs.tencentyun.com/xinnan/xiaozhi-esp32-server:latest +docker run -d --name xiaozhi-esp32-server --restart always --security-opt seccomp:unconfined -p 8000:8000 -v $(pwd)/config.yaml:/opt/xiaozhi-es32-server/config.yaml ccr.ccs.tencentyun.com/xinnan/xiaozhi-esp32-server:latest ``` 如果首次执行,可能需要几分钟时间,你要耐心等待他完成拉取。正常拉取完成后,你可以在命令行执行以下命令查看服务是否启动成功 diff --git a/README_en.md b/README_en.md index e1fa14de..54b75e9d 100644 --- a/README_en.md +++ b/README_en.md @@ -137,7 +137,7 @@ If you can see the `config.yaml` file, you have indeed entered the `project dire command: ``` -docker run -d --name xiaozhi-esp32-server --restart always -p 8000:8000 -v ./config.yaml:/opt/xiaozhi-es32-server/config.yaml ccr.ccs.tencentyun.com/xinnan/xiaozhi-esp32-server:latest +docker run -d --name xiaozhi-esp32-server --restart always --security-opt seccomp:unconfined -p 8000:8000 -v $(pwd)/config.yaml:/opt/xiaozhi-es32-server/config.yaml ccr.ccs.tencentyun.com/xinnan/xiaozhi-esp32-server:latest ``` If executed for the first time, it may take several minutes, and you have to be patient to wait for it to complete the diff --git a/docs/docker-build.md b/docs/docker-build.md index dee54d44..412ac846 100644 --- a/docs/docker-build.md +++ b/docs/docker-build.md @@ -14,7 +14,7 @@ docker stop xiaozhi-esp32-server docker rm xiaozhi-esp32-server cp /Users/hrz/myworkspace/esp32/xiaozhi-esp32-server/config.yaml ./ -docker run -d --name xiaozhi-esp32-server --restart always -p 8000:8000 -v ./config.yaml:/opt/xiaozhi-es32-server/config.yaml xiaozhi-esp32-server:local +docker run -d --name xiaozhi-esp32-server --restart always -p 8000:8000 -v $(pwd)/config.yaml:/opt/xiaozhi-es32-server/config.yaml xiaozhi-esp32-server:local docker logs -f xiaozhi-esp32-server @@ -43,5 +43,7 @@ docker manifest push ccr.ccs.tencentyun.com/xinnan/xiaozhi-esp32-server:latest ``` 6、运行线上镜像 ``` -docker run -d --name xiaozhi-esp32-server --restart unless-stopped -p 8000:8000 ccr.ccs.tencentyun.com/xinnan/xiaozhi-esp32-server:latest-amd64 +cd /Users/hrz/myworkspace/docker-java-env/thirddata/ +docker run -d --name xiaozhi-esp32-server --restart always -p 8000:8000 -v $(pwd)/config.yaml:/opt/xiaozhi-es32-server/config.yaml ccr.ccs.tencentyun.com/xinnan/xiaozhi-esp32-server:latest +docker logs -f xiaozhi-esp32-server ``` \ No newline at end of file