chore: optimize Dockerfile apt source compatibility and update edge.yaml cloud/ota URLs to port 9000
- Dockerfile: support both legacy sources.list and DEB822 format for apt mirror - Dockerfile: use official python:3.9-slim instead of Huawei Cloud SWR mirror - .dockerignore: exclude !build/edge-agent to avoid build artifact in context - edge.yaml: change cloud_url from 8004 to 9000 (stream-gateway) - edge.yaml: change ota_url from 8087 to 9000 - Add Dockerfile.bak and buildkitd.toml
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
.git/
|
.git/
|
||||||
.gitignore
|
.gitignore
|
||||||
build/
|
build/
|
||||||
|
!build/edge-agent
|
||||||
data/
|
data/
|
||||||
*.om
|
*.om
|
||||||
*.onnx
|
*.onnx
|
||||||
|
|||||||
14
Dockerfile
14
Dockerfile
@@ -1,10 +1,16 @@
|
|||||||
# 使用华为云镜像加速的 Python 3.9 Slim
|
# 使用华为云镜像加速的 Python 3.9 Slim
|
||||||
FROM swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/library/python:3.9-slim
|
FROM python:3.9-slim
|
||||||
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
# 安装 ffmpeg, curl 及 OpenCV 基础依赖 (使用华为云 apt 源)
|
# 替换 apt 源为华为云镜像(兼容 Debian 11 旧格式和 Debian 12/13 DEB822 格式)
|
||||||
RUN sed -i 's/deb.debian.org/repo.huaweicloud.com/g' /etc/apt/sources.list && \
|
RUN if [ -f /etc/apt/sources.list ]; then \
|
||||||
sed -i 's/security.debian.org/repo.huaweicloud.com/g' /etc/apt/sources.list && \
|
sed -i 's/deb.debian.org/repo.huaweicloud.com/g' /etc/apt/sources.list && \
|
||||||
|
sed -i 's/security.debian.org/repo.huaweicloud.com/g' /etc/apt/sources.list; \
|
||||||
|
fi && \
|
||||||
|
if [ -f /etc/apt/sources.list.d/debian.sources ]; then \
|
||||||
|
sed -i 's|https\?://deb.debian.org|http://repo.huaweicloud.com|g' /etc/apt/sources.list.d/debian.sources && \
|
||||||
|
sed -i 's|https\?://security.debian.org|http://repo.huaweicloud.com|g' /etc/apt/sources.list.d/debian.sources; \
|
||||||
|
fi && \
|
||||||
apt-get update && apt-get install -y --no-install-recommends \
|
apt-get update && apt-get install -y --no-install-recommends \
|
||||||
ffmpeg curl libgl1 libglib2.0-0 \
|
ffmpeg curl libgl1 libglib2.0-0 \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|||||||
38
Dockerfile.bak
Normal file
38
Dockerfile.bak
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
# 使用华为云镜像加速的 Python 3.9 Slim
|
||||||
|
FROM swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/library/python:3.9-slim
|
||||||
|
|
||||||
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
# 安装 ffmpeg, curl 及 OpenCV 基础依赖 (使用华为云 apt 源)
|
||||||
|
RUN sed -i 's/deb.debian.org/repo.huaweicloud.com/g' /etc/apt/sources.list && \
|
||||||
|
sed -i 's/security.debian.org/repo.huaweicloud.com/g' /etc/apt/sources.list && \
|
||||||
|
apt-get update && apt-get install -y --no-install-recommends \
|
||||||
|
ffmpeg curl libgl1 libglib2.0-0 \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
WORKDIR /opt/tianyan
|
||||||
|
|
||||||
|
# 1. 复制已编译的 Go 二进制 (由宿主机构建)
|
||||||
|
COPY build/edge-agent /opt/tianyan/edge-agent
|
||||||
|
|
||||||
|
# 2. 安装 Python 依赖 (使用华为云 pip 源)
|
||||||
|
COPY python/requirements.txt .
|
||||||
|
RUN pip3 install --no-cache-dir -r requirements.txt -i https://repo.huaweicloud.com/repository/pypi/simple \
|
||||||
|
&& rm -rf /root/.cache/pip
|
||||||
|
|
||||||
|
# 3. 复制业务代码与脚本
|
||||||
|
COPY python/ /opt/tianyan/python/
|
||||||
|
COPY scripts/ /opt/tianyan/scripts/
|
||||||
|
|
||||||
|
# 4. 创建运行时目录
|
||||||
|
RUN mkdir -p /opt/tianyan/config /opt/tianyan/model /tmp
|
||||||
|
|
||||||
|
# 环境变量 (CANN 路径将由 docker-compose 挂载覆盖)
|
||||||
|
ENV PYTHONPATH=/usr/local/Ascend/ascend-toolkit/latest/python/site-packages
|
||||||
|
ENV LD_LIBRARY_PATH=/usr/local/Ascend/ascend-toolkit/latest/lib64:/usr/local/Ascend/driver/lib64
|
||||||
|
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
||||||
|
|
||||||
|
# 启动脚本
|
||||||
|
COPY entrypoint.sh /opt/tianyan/entrypoint.sh
|
||||||
|
RUN chmod +x /opt/tianyan/entrypoint.sh
|
||||||
|
|
||||||
|
ENTRYPOINT ["/opt/tianyan/entrypoint.sh"]
|
||||||
2
buildkitd.toml
Normal file
2
buildkitd.toml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
[registry."docker.io"]
|
||||||
|
mirrors = ["docker.1panel.live", "docker.1panel.dev", "docker.1ms.run"]
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
device_uuid: 8541db9f77826e39605ef2c032f8fb93
|
device_uuid: 8541db9f77826e39605ef2c032f8fb93
|
||||||
edge_id: edge-demo-001
|
edge_id: edge-demo-001
|
||||||
cloud_url: http://101.36.73.102:8004
|
cloud_url: http://101.36.73.102:9000
|
||||||
mqtt_broker: tcp://101.36.73.102:1883
|
mqtt_broker: tcp://101.36.73.102:1883
|
||||||
mqtt_user: ""
|
mqtt_user: ""
|
||||||
mqtt_pass: ""
|
mqtt_pass: ""
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
device_uuid: 8541db9f77826e39605ef2c032f8fb93
|
device_uuid: 8541db9f77826e39605ef2c032f8fb93
|
||||||
edge_id: edge-demo-001
|
edge_id: edge-demo-001
|
||||||
cloud_url: http://101.36.73.102:8004
|
cloud_url: http://101.36.73.102:9000
|
||||||
mqtt_broker: tcp://101.36.73.102:1883
|
mqtt_broker: tcp://101.36.73.102:1883
|
||||||
mqtt_user: ""
|
mqtt_user: ""
|
||||||
mqtt_pass: ""
|
mqtt_pass: ""
|
||||||
@@ -12,5 +12,5 @@ infer_fps: 2
|
|||||||
infer_workers: 3
|
infer_workers: 3
|
||||||
conf_threshold: 0.2
|
conf_threshold: 0.2
|
||||||
dedup_window_sec: 30
|
dedup_window_sec: 30
|
||||||
ota_url: http://101.36.73.102:8087
|
ota_url: http://101.36.73.102:9000
|
||||||
version: 1.0.0
|
version: 1.0.0
|
||||||
|
|||||||
Reference in New Issue
Block a user