您现在的位置是:热点 >>正文
使用Docker多阶段多平台编译Qt
热点38624371人已围观
简介...
Docker 中的多平台如何工作?
在 Docker 中使用多平台功能的最简单方法是从命令行调用它。使用docker buildx,我们可以利用新的测试版功能。通过运行docker buildx使用 build --platform linux/arm/v7 -t arm-build 。此命令使用 ARMv7 仿真根据当前目录中的“Dockerfile”构建 docker 映像。在幕后,Docker 在 QEDoMU 虚拟化环境(qemu-user-static准确地说)中运行整个 Docker 构建过程。通过这样做,可以消除设置自定义 VM 的复杂性。一旦构建完成,我们甚至可以使用docker runARMv7ck 模式自动启动容器。
多平台、多阶段和Qt
虽然多平台功能是一个很棒的独立功能,但与多阶段构建结合使用时它会变得更加强大。在单个 Dockerfile 中,我们能够混合和匹配平台并在步骤之间进行复er制。这个功能正是我们最终为 Screenly OSE 使用 Qt 构建过程所做的。
第一阶段:ARM
感谢Balena的优秀人员,我们能够在第一阶段使用 Raspbian 基础映像。我们可以使用以下方法调用多阶此步骤:
FROM --platform=linux/arm/v7 balenalib/rpi-raspbian:buster as builder
在上述步骤之后,我们可以像往常一样使用 Docker 并段多执行各种RUN命令,例如安装包等。请注意,如果构建不是在 ARMv7 硬件上运行,则此容器正在使用 QEMU 模拟运行。在我们的例子中,我们使用命令来安装 Qt 构建依赖项。上述步骤还允许我们完全平台消除从磁盘映像(这是Qt Wiki建议的)或rsync物理 Raspberry Pi 的文件复制文件的需要。
第 2 阶段:x86
一旦我们在 ARM 步骤中安装了依赖项,我们就可以切换到构建器的原生 x86 架编译构以避免仿真,并使用以下行进行交叉编译:
FROM --platform=linux/amd64 debian:buster
现在,我们进入了有趣的部分。切换到 x86 后,我们可以复制上一步中的文件。Qt我们这样做是为了创建一个可用于 Qt 的 sysroot。我们通过运行以下命令来完成此步骤:
RUN mkdir -p /sysroot/usr /sysroot/opt /sysroot/lib
COP使用Y --from=builder /lib/ /sysroot/lib/
COPY --from=builder /usr/include/ /sysroot/usr/include/
COPY --fromDo=builder /usr/lib/ /sysroot/usr/lib/
COPY --from=builder /opt/vc/ sysroot/opt/vc/
我们现在拥有两全其美的优势。通过利用多步骤ck和多平台功能,我们生成了一个可用于构建 Qt 的 sysroot。由于我们在上一步中使用了功能齐全的 Raspbian 映像,我们甚至可以让 Qt 获取所有现有的库。
./configure \
&nerbsp; -sysroot /sysroot
正如我们在介绍中提到的,编译 Qt 远非简单。成功编译它需要很多步骤。
Tags:
相关文章
6天后正式发布,5nm芯片再添一重量级成员,与苹果抢市场
热点目前,在手机市场中,5nm芯片的机型只有华为和苹果,这两家独占鳌头。而华为又货源不足,所以算下来只有苹果一家可以自由购入体验。这一定让大家颇为无奈吧?不过,好消息是5nm芯片将再添一重量级成员,6天后...
【热点】
阅读更多标签: 证监会 老虎证券 富途证券 长桥证券
热点云梦级5月22日云梦级消息,据新华社报道,中国证监会5月22日宣布,Tiger Brokers(NZ)Limited、富途证券国际(香港)有限公司、长桥证券(香港)有限公司的非法跨境展业行为,违反了我...
【热点】
阅读更多数据分析终极一问:多影响因素下,到底咋归因?!
热点本文转载自微信公众号「接地气学堂」,作者接地气的陈老师 。转载本文请联系接地气学堂公众号。 数据分析领域有几个经典的终极难题。多影响因素归因,绝对是其中最让人头大的。特别是临近年底,品牌、售后、客服、...
【热点】
阅读更多
热门文章
最新文章
友情链接
- 标签: 康师傅
- https://www.safetv.go.kr/base/search/view?searchWord=快排霸屏软件【tg:seogoogle987】QdY
- https://www.kubb-tool.bfs.admin.ch/en/search?action=CHECK&q=快排霸屏软件【tg:seogoogle987】,OWc
- https://www.wattpad.com/search/快排霸屏软件【tg:seogoogle987】Bb3
- https://www.searcychamber.com/list/search?AsfnA=DtkTQzs&q=快排霸屏软件【tg:seogoogle987】,cG4
- https://search.danawa.com/dsearch.php?query=快排霸屏软件【tg:seogoogle987】OHF
- https://www.libros.unam.mx/catalogsearch/result/?cat=37&dir=asc&format=20&lit=20&manufacturer=3230&mode=list&order=year_edition&q=快排霸屏软件【tg:seogoogle987】,NAD
- https://www.msrenewal.com/search/快排霸屏软件【tg:seogoogle987】,78c
- https://www.oprny.com/search.php?search_query=快排霸屏软件【tg:seogoogle987】,Wak
- https://www.yli.ro/catalogsearch/result/?q=快排霸屏软件【tg:seogoogle987】,eBE
- https://www.lgnewsroom.com/search/快排霸屏软件【tg:seogoogle987】,9zA
- https://www.impactpool.org/search/?type=79&q=快排霸屏软件【tg:seogoogle987】ZA2
- https://www.parl.ca/legisinfo/fr/projets-de-loi?parlsession=all&view=list&keywords=快排霸屏软件【tg:seogoogle987】,mzF
- https://www.remit.co.jp/vi/?s=快排霸屏软件【tg:seogoogle987】276
- https://www.solerpalau.com/en-en/catalogsearch/result/?q=快排霸屏软件【tg:seogoogle987】,LM8
- https://www.uctronics.com/catalogsearch/result/?q=快排霸屏软件【tg:seogoogle987】,Eop
- https://www.maigoo.com/search/?block=&q=快排霸屏软件【tg:seogoogle987】,lLK
- https://www.terramania.nl/catalogsearch/result/index/?q=快排霸屏软件【tg:seogoogle987】,hCv
- https://www.vocabulary.com/dictionary/快排霸屏软件【tg:seogoogle987】,3LB
- https://www.lssystems.co.uk/search?page=0&per_page=24&term=快排霸屏软件【tg:seogoogle987】,rDF
- https://www.lyrics.com/lyrics/快排霸屏软件【tg:seogoogle987】,qm0
- https://www.lenovo.com/gb/en/search?action=SEARCH&text=快排霸屏软件【tg:seogoogle987】,5vZ
- https://www.randjleather.co.uk/index.php?route=product/search&tag=快排霸屏软件【tg:seogoogle987】,N6O
- https://www.losgatoschamber.com/list/search?action=SEARCH&q=快排霸屏软件【tg:seogoogle987】,wCz
- https://www.remit.co.jp/pt/?action=CHECK&s=快排霸屏软件【tg:seogoogle987】,KcQ
- https://www.signingsavvy.com/sentence/快排霸屏软件【tg:seogoogle987】,Zd9
- https://www.zutari.com/search/快排霸屏软件【tg:seogoogle987】,jDj
- https://www.wuv.edu/?s=快排霸屏软件【tg:seogoogle987】,Reu
- https://www.totolink.vn/search/快排霸屏软件【tg:seogoogle987】,w73
- https://www.roberthalf.com/us/en/jobs/all/快排霸屏软件【tg:seogoogle987】8j4
- https://blvdseafood.com/?s=快排霸屏软件【tg:seogoogle987】Xz4
- https://www.mexperience.com/?T=1686132112324&s=快排霸屏软件【tg:seogoogle987】,twI
- https://www.nslcleaders.org/?s=快排霸屏软件【tg:seogoogle987】,jqD
- https://www.metaltix.com/?view=tours&filter=search&q=快排霸屏软件【tg:seogoogle987】,3Hn
- https://www.zutari.com/?s=快排霸屏软件【tg:seogoogle987】,fTz
- https://www.wou.edu.my/?s=快排霸屏软件【tg:seogoogle987】,s7d
- https://www.youm7.com/Home/Search?allwords=快排霸屏软件【tg:seogoogle987】,hia
- https://www.hanbat.ac.kr/search/front/Search.jsp?qt=快排霸屏软件【tg:seogoogle987】Exu
- https://www.navymwr.org/search/?query=快排霸屏软件【tg:seogoogle987】,Rlu
- https://www.skicheck.at/en/?action=CHECK&s=快排霸屏软件【tg:seogoogle987】,Mtj
- https://www.reallywildbirdfood.co.uk/store/search?q=快排霸屏软件【tg:seogoogle987】,Bwq
- https://xn--lgernevedlystskoven-lxb.dk/search/快排霸屏软件【tg:seogoogle987】,4rB
- https://zhidao.baidu.com/index/?action=QUERY&word=快排霸屏软件【tg:seogoogle987】,eiz
- https://www.reginatangoshoes.com/en/catalogsearch/result/index/?T=1686132113407&q=快排霸屏软件【tg:seogoogle987】,K1w
- https://www.zalora.sg/catalog/?cat=112&q=快排霸屏软件【tg:seogoogle987】,uOW
- https://www.ntv.co.jp/3min/search/?action=QUERY&q=快排霸屏软件【tg:seogoogle987】,vc7
- https://www.xvideos.com/tags/快排霸屏软件【tg:seogoogle987】,Lyc
- https://www.tarleton.edu/news/search/快排霸屏软件【tg:seogoogle987】,Tvk
- https://www.krisinformation.se/en/search?q=快排霸屏软件【tg:seogoogle987】,wpm
- https://5gaa.org/?token=6e2l7hjt2i26gzgctgwdrv7v0j6nxorq&s=快排霸屏软件【tg:seogoogle987】faE
- https://www.qylaws.com/search/快排霸屏软件【tg:seogoogle987】,TFP