-
Notifications
You must be signed in to change notification settings - Fork 148
Expand file tree
/
Copy pathDockerfile.x86
More file actions
107 lines (93 loc) · 3.37 KB
/
Copy pathDockerfile.x86
File metadata and controls
107 lines (93 loc) · 3.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
ARG BUILD_ENV_IMAGE=ghcr.io/cosmo-wander-ai/cosmo_edge-build-env_x86:v1
ARG RUNTIME_BASE_IMAGE=debian:12-slim
FROM ${BUILD_ENV_IMAGE} AS builder
WORKDIR /src
COPY . .
# Windows Git may check out symlinks as small text files. Recreate Linux
# shared-library links inside the build container before linking against them.
RUN find prebuild 3rd -path '*/lib/*.so*' -type f -size -256c -print | while IFS= read -r link; do \
target="$(cat "${link}")"; \
case "${target}" in \
*.so|*.so.*) \
dir="$(dirname "${link}")"; \
if [ -e "${dir}/${target}" ]; then \
rm -f "${link}"; \
ln -s "${target}" "${link}"; \
fi; \
;; \
esac; \
done
ARG RESOURCE_DIR=data/resource/aiboxresource_x86
ARG COSMO_BUILD_JOBS
RUN if [ -n "${RESOURCE_DIR}" ]; then \
bash ./scripts/build_cpu.sh -t -m "${RESOURCE_DIR}"; \
else \
bash ./scripts/build_cpu.sh -t; \
fi
FROM ${RUNTIME_BASE_IMAGE} AS runtime
ENV DEBIAN_FRONTEND=noninteractive
ENV INSTALLPATH=/appfs/cosmo_wander/cwai_data
ENV COSMO_PLATFORM_TYPE=x86_64
# Install ca-certificates before switching to HTTPS mirrors.
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Use the Aliyun Debian mirror for runtime package installation.
RUN sed -i 's|http://deb.debian.org/debian|https://mirrors.aliyun.com/debian|g' /etc/apt/sources.list.d/debian.sources 2>/dev/null || \
sed -i 's|http://deb.debian.org/debian|https://mirrors.aliyun.com/debian|g' /etc/apt/sources.list
RUN apt-get update && apt-get install -y --no-install-recommends \
nginx \
iproute2 \
libatomic1 \
libbrotli1 \
libgcc-s1 \
libstdc++6 \
net-tools \
psmisc \
procps \
sysvinit-utils \
libx11-6 \
libxau6 \
libxcb1 \
libxdmcp6 \
libxext6 \
libxrender1 \
libxfixes3 \
libxi6 \
libxrandr2 \
libxss1 \
libxtst6 \
libglib2.0-0 \
libglib2.0-bin \
zlib1g \
libpng16-16 \
libjpeg62-turbo \
libfreetype6 \
libfontconfig1 \
libxcb-shm0 \
libxcb-shape0 \
libxcb-render0 \
libxcb-randr0 \
libxcb-xfixes0 \
libxcb-sync1 \
libxcb-xinerama0 \
libxcb-xkb1 \
libxkbcommon0 \
libxkbcommon-x11-0 \
libdbus-1-3 \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /src/build_cpu/install/ /appfs/cosmo_wander/cwai_data/
COPY --from=builder /src/build_cpu/packages/ /cosmo-packages/
COPY scripts/docker-entrypoint.x86.sh /usr/local/bin/cosmo-x86-entrypoint
COPY scripts/docker-healthcheck.x86.sh /usr/local/bin/cosmo-x86-healthcheck
RUN chmod +x /usr/local/bin/cosmo-x86-entrypoint /usr/local/bin/cosmo-x86-healthcheck \
&& mkdir -p /data/cwaiuserdata/log/logs /data/cwaiuserdata/upgrade \
&& mkdir -p /appfs/cosmo_wander/cwai_data/bin/nginx_conf/logs \
&& mkdir -p /appfs/cosmo_wander/cwai_data/web/staticfile \
&& ln -sf /appfs/cosmo_wander/cwai_data/files/Interface/ai-box-interface_v1.0.html \
/appfs/cosmo_wander/cwai_data/web/staticfile/httpInterface.html \
&& ln -sf /appfs/cosmo_wander/cwai_data/files/Interface/mqtt_v1.0.html \
/appfs/cosmo_wander/cwai_data/web/staticfile/mqttInterface.html
WORKDIR /appfs/cosmo_wander/cwai_data
EXPOSE 80 1936 1985 18088 8000/udp
ENTRYPOINT ["/usr/local/bin/cosmo-x86-entrypoint"]