Skip to content

Commit

Permalink
Build(docker): 🏗️ 修复 cffi 构建
Browse files Browse the repository at this point in the history
  • Loading branch information
a76yyyy committed Nov 12, 2023
1 parent 5e56418 commit 0dee690
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ RUN sed -i 's/mirrors.ustc.edu.cn/dl-cdn.alpinelinux.org/g' /etc/apk/repositorie
py3-packaging py3-greenlet py3-urllib3 py3-cryptography \
py3-aiosignal py3-async-timeout py3-attrs py3-frozenlist \
py3-multidict py3-charset-normalizer py3-aiohttp \
py3-typing-extensions py3-yarl && \
py3-typing-extensions py3-yarl py3-cffi && \
[[ $(getconf LONG_BIT) = "32" ]] && \
echo "Tips: 32-bit systems do not support ddddocr, so there is no need to install numpy and opencv-python" || \
apk add --update --no-cache py3-numpy-dev py3-opencv py3-pillow && \
Expand Down Expand Up @@ -54,6 +54,7 @@ RUN sed -i 's/mirrors.ustc.edu.cn/dl-cdn.alpinelinux.org/g' /etc/apk/repositorie
sed -i '/aiohttp/d' requirements.txt && \
sed -i '/typing-extensions/d' requirements.txt && \
sed -i '/yarl/d' requirements.txt && \
sed -i '/cffi/d' requirements.txt && \
pip install --no-cache-dir -r requirements.txt --break-system-packages && \
apk del .build_deps && \
sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories && \
Expand All @@ -69,4 +70,4 @@ ENV TZ=CST-8
# 添加挂载点
VOLUME ["/usr/src/app/config"]

CMD ["sh","-c","python /usr/src/app/run.py"]
CMD ["sh","-c","python /usr/src/app/run.py"]
5 changes: 3 additions & 2 deletions Dockerfile.ja3
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ RUN sed -i 's/mirrors.ustc.edu.cn/dl-cdn.alpinelinux.org/g' /etc/apk/repositorie
apk add --update --no-cache python3 py3-six py3-markupsafe py3-pycryptodome py3-tornado \
py3-wrapt py3-packaging py3-greenlet py3-urllib3 py3-cryptography py3-aiosignal \
py3-async-timeout py3-attrs py3-frozenlist py3-multidict py3-charset-normalizer \
py3-aiohttp py3-typing-extensions py3-yarl && \
py3-aiohttp py3-typing-extensions py3-yarl py3-cffi && \
[[ $(getconf LONG_BIT) = "32" ]] && \
echo "Tips: 32-bit systems do not support ddddocr, so there is no need to install numpy and opencv-python" || \
apk add --update --no-cache py3-opencv py3-pillow && \
Expand All @@ -54,6 +54,7 @@ RUN sed -i 's/mirrors.ustc.edu.cn/dl-cdn.alpinelinux.org/g' /etc/apk/repositorie
sed -i '/aiohttp/d' requirements.txt && \
sed -i '/typing-extensions/d' requirements.txt && \
sed -i '/yarl/d' requirements.txt && \
sed -i '/cffi/d' requirements.txt && \
pip install --no-cache-dir -r requirements.txt --break-system-packages && \
apk del .build_deps && \
sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories && \
Expand All @@ -69,4 +70,4 @@ ENV TZ=CST-8
# 添加挂载点
VOLUME ["/usr/src/app/config"]

CMD ["sh","-c","python /usr/src/app/run.py"]
CMD ["sh","-c","python /usr/src/app/run.py"]
5 changes: 3 additions & 2 deletions Dockerfile.lite
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ WORKDIR /usr/src/app
# QD & Pip install modules
RUN sed -i 's/mirrors.ustc.edu.cn/dl-cdn.alpinelinux.org/g' /etc/apk/repositories && \
# ln -s /usr/bin/python3 /usr/bin/python && \
apk update && apk add --update --no-cache openssh-client python3 py3-six py3-markupsafe py3-pycryptodome py3-tornado py3-wrapt py3-packaging py3-greenlet py3-urllib3 py3-cryptography py3-aiosignal py3-async-timeout py3-attrs py3-frozenlist py3-multidict py3-charset-normalizer py3-aiohttp py3-typing-extensions py3-yarl && \
apk update && apk add --update --no-cache openssh-client python3 py3-six py3-markupsafe py3-pycryptodome py3-tornado py3-wrapt py3-packaging py3-greenlet py3-urllib3 py3-cryptography py3-aiosignal py3-async-timeout py3-attrs py3-frozenlist py3-multidict py3-charset-normalizer py3-aiohttp py3-typing-extensions py3-yarl py3-cffi && \
chmod 600 /root/.ssh/id_rsa && \
ssh-keyscan gitee.com > /root/.ssh/known_hosts && \
let num=$RANDOM%100+10 && \
Expand Down Expand Up @@ -47,6 +47,7 @@ RUN sed -i 's/mirrors.ustc.edu.cn/dl-cdn.alpinelinux.org/g' /etc/apk/repositorie
sed -i '/aiohttp/d' requirements.txt && \
sed -i '/typing-extensions/d' requirements.txt && \
sed -i '/yarl/d' requirements.txt && \
sed -i '/cffi/d' requirements.txt && \
pip install --no-cache-dir -r requirements.txt --break-system-packages && \
apk del .build_deps && \
sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories && \
Expand All @@ -63,4 +64,4 @@ ENV TZ=CST-8
# 添加挂载点
VOLUME ["/usr/src/app/config"]

CMD ["sh","-c","python /usr/src/app/run.py"]
CMD ["sh","-c","python /usr/src/app/run.py"]

0 comments on commit 0dee690

Please sign in to comment.