惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Martin Fowler
Martin Fowler
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
A
About on SuperTechFans
Apple Machine Learning Research
Apple Machine Learning Research
The Register - Security
The Register - Security
Vercel News
Vercel News
H
Hackread – Cybersecurity News, Data Breaches, AI and More
人人都是产品经理
人人都是产品经理
MyScale Blog
MyScale Blog
云风的 BLOG
云风的 BLOG
博客园_首页
U
Unit 42
T
Tailwind CSS Blog
G
GRAHAM CLULEY
F
Full Disclosure
V
Vulnerabilities – Threatpost
T
Tenable Blog
月光博客
月光博客
P
Privacy & Cybersecurity Law Blog
P
Privacy International News Feed
K
Kaspersky official blog
Scott Helme
Scott Helme
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
N
News and Events Feed by Topic
T
The Exploit Database - CXSecurity.com
N
News and Events Feed by Topic
有赞技术团队
有赞技术团队
Recent Commits to openclaw:main
Recent Commits to openclaw:main
L
LINUX DO - 最新话题
Recorded Future
Recorded Future
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Help Net Security
Help Net Security
The GitHub Blog
The GitHub Blog
Cisco Talos Blog
Cisco Talos Blog
SecWiki News
SecWiki News
P
Proofpoint News Feed
Security Latest
Security Latest
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
罗磊的独立博客
S
Security Affairs
M
MIT News - Artificial intelligence
L
LINUX DO - 热门话题
美团技术团队
Simon Willison's Weblog
Simon Willison's Weblog
T
Threat Research - Cisco Blogs
Stack Overflow Blog
Stack Overflow Blog
Forbes - Security
Forbes - Security
Hugging Face - Blog
Hugging Face - Blog
博客园 - Franky
V
Visual Studio Blog

ThinkAlone

JavaCard 上手 灵车!开创! Step-CA 日常使用教程 灵上加灵:使用 Pico HSM 和 step-ca 自建一个CA 友善 FriendlyELEC NanoPC-T4 CPU跑分测试 CPU Benchmark 常见物品尺寸记录 树莓派5 Raspberry Pi 5 CPU跑分测试 CPU Benchmark 鼎阳 SDS804X HD 示波器带宽与选件升级 OrangePi Zero3 CPU跑分测试 CPU Benchmark Canokey Canary上手 在2024年配置IPv6是什么怎样一种体验 用 Orange Pi Zero 搭建一台 Stratum 1 的 NTP 服务器 难绷的Zip与中文密码 OrangePi Zero CPU跑分测试 CPU Benchmark 使用 Docker 部署 zhenxun_bot(绪山真寻Bot) 在Docker中运行Klipper 如何优雅的跳过/禁止Steam更新你的游戏 使用 GitHub Actions 自动部署Hexo 使用 Travis CI 自动构建 Hexo 博客 CoffeeMiner:劫持WiFi网络接入设备进行“挖矿”的框架
使DockerHub的Autobuild自动构建ARM/其他 架构的镜像
Disappear9 · 2018-12-12 · via ThinkAlone

起因:

最近在使用 bilive_client挂B站的直播和主站日常任务,由于每次更新都需要重新编译+管理node环境太麻烦,所以开始使用Docker

遇到的坑:

首先,Google一下找到了这个https://github.com/docker/hub-feedback/issues/1261https://github.com/davidecavestro/mariadb-docker-armhf 这个示例,按照里面说的在Dockerfile同级目录下建立hooks文件夹,并放入post_checkoutpre_build

1
2
3
4
hooks
|——pre_build
|——post_checkout
Dockerfile
pre_build
1
2
#!/bin/bash
docker run --rm --privileged multiarch/qemu-user-static:register --reset
post_checkout
1
2
#!/bin/bash
curl -L https://github.com/balena-io/qemu/releases/download/v3.0.0%2Bresin/qemu-3.0.0+resin-arm.tar.gz | tar zxvf - -C . && mv qemu-3.0.0+resin-arm/qemu-arm-static .

然后在Dockerfile里加入一行

1
COPY qemu-arm-static /usr/bin

然而并没有卵用

检查日志,发现Autobuild提示no such a file or dictionary(黑人问号.jpg)这就让人头疼了
继续Google,发现有人已经反馈过这个情况 https://forums.docker.com/t/resolved-automated-docker-build-fails/22831 官方确认是Bug而且被标记为已解决(再次黑人问号.jpg)
解决了个卵啊?

没办法了,直接上二段构建
先把qemu-***-static放到项目里,如果是(ARMv8 64)使用qemu-aarch64-static

Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

FROM alpine AS builder

MAINTAINER Disappear9

RUN apk --no-cache add unzip \
&& wget https://github.com/Disappear9/bilive_client_docker/archive/master.zip \
&& unzip master.zip \
&& mkdir /qemu \
&& cp bilive_client_docker-master/qemu/* /qemu \
&& rm master.zip \

&& wget https://github.com/lzghzr/bilive_client/archive/master.zip \
&& unzip master.zip \
&& mkdir /app \
&& mv bilive_client-master/* /app


FROM arm32v6/node:alpine AS release

COPY --from=builder /qemu/qemu-arm-static /usr/bin
COPY --from=builder /app /app

最后,附上Github地址 https://github.com/Disappear9/bilive_client_docker 欢迎参考
DockerHub地址 https://hub.docker.com/r/disappear9/bilive_client

还有一些问题

Autobuild只有在Github有push时才会触发,这就很尴尬,在源码更新时需要手动触发……