2025-02-02 23:01:14 +08:00
|
|
|
# 编译docker镜像
|
|
|
|
|
1、安装docker
|
|
|
|
|
```
|
|
|
|
|
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
|
|
|
|
|
```
|
|
|
|
|
2、编译docker镜像
|
|
|
|
|
```
|
2025-02-06 02:08:58 +08:00
|
|
|
# 普通编译
|
2025-02-02 23:01:14 +08:00
|
|
|
docker build -t xiaozhi-esp32-server:local -f ./Dockerfile .
|
|
|
|
|
```
|
|
|
|
|
3、测试本地镜像
|
|
|
|
|
```
|
|
|
|
|
docker stop xiaozhi-esp32-server
|
|
|
|
|
docker rm xiaozhi-esp32-server
|
|
|
|
|
|
2025-02-06 11:01:05 +08:00
|
|
|
cd /Users/hrz/myworkspace/docker-java-env/thirddata/
|
2025-02-06 02:08:58 +08:00
|
|
|
cp /Users/hrz/myworkspace/esp32/xiaozhi-esp32-server/config.yaml ./
|
2025-02-06 09:33:18 +08:00
|
|
|
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
|
2025-02-06 02:08:58 +08:00
|
|
|
|
|
|
|
|
docker logs -f xiaozhi-esp32-server
|
|
|
|
|
|
2025-02-02 23:01:14 +08:00
|
|
|
```
|
|
|
|
|
5、发布腾讯云镜像
|
|
|
|
|
```
|
|
|
|
|
# amd64
|
|
|
|
|
docker tag xiaozhi-esp32-server:local ccr.ccs.tencentyun.com/xinnan/xiaozhi-esp32-server:latest-amd64
|
|
|
|
|
docker push ccr.ccs.tencentyun.com/xinnan/xiaozhi-esp32-server:latest-amd64
|
|
|
|
|
|
|
|
|
|
# arm64
|
|
|
|
|
docker tag xiaozhi-esp32-server:local ccr.ccs.tencentyun.com/xinnan/xiaozhi-esp32-server:latest-arm64
|
|
|
|
|
docker push ccr.ccs.tencentyun.com/xinnan/xiaozhi-esp32-server:latest-arm64
|
|
|
|
|
|
|
|
|
|
# 合并版本号
|
|
|
|
|
docker manifest create ccr.ccs.tencentyun.com/xinnan/xiaozhi-esp32-server:1.0.0 ccr.ccs.tencentyun.com/xinnan/xiaozhi-esp32-server:latest-amd64 ccr.ccs.tencentyun.com/xinnan/xiaozhi-esp32-server:latest-arm64 --amend
|
|
|
|
|
docker manifest inspect ccr.ccs.tencentyun.com/xinnan/xiaozhi-esp32-server:1.0.0
|
|
|
|
|
docker manifest push ccr.ccs.tencentyun.com/xinnan/xiaozhi-esp32-server:1.0.0
|
|
|
|
|
|
|
|
|
|
# 推送最新版本
|
|
|
|
|
docker manifest rm ccr.ccs.tencentyun.com/xinnan/xiaozhi-esp32-server:latest
|
|
|
|
|
docker manifest create ccr.ccs.tencentyun.com/xinnan/xiaozhi-esp32-server:latest ccr.ccs.tencentyun.com/xinnan/xiaozhi-esp32-server:latest-amd64 ccr.ccs.tencentyun.com/xinnan/xiaozhi-esp32-server:latest-arm64 --amend
|
|
|
|
|
docker manifest inspect ccr.ccs.tencentyun.com/xinnan/xiaozhi-esp32-server:latest
|
|
|
|
|
docker manifest push ccr.ccs.tencentyun.com/xinnan/xiaozhi-esp32-server:latest
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
6、运行线上镜像
|
|
|
|
|
```
|
2025-02-06 09:33:18 +08:00
|
|
|
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
|
2025-02-02 23:01:14 +08:00
|
|
|
```
|