本站面向开发者与科研用户,提供开源镜像的搜索和下载加速服务。
所有镜像均来源于原始开源仓库,本站不存储、不修改、不传播任何镜像内容。

crossbuild Docker 镜像下载 - 轩辕镜像

crossbuild 镜像详细信息和使用指南

crossbuild 镜像标签列表和版本信息

crossbuild 镜像拉取命令和加速下载

crossbuild 镜像使用说明和配置指南

Docker 镜像加速服务 - 轩辕镜像平台

国内开发者首选的 Docker 镜像加速平台

极速拉取 Docker 镜像服务

相关 Docker 镜像推荐

热门 Docker 镜像下载

crossbuild
multiarch/crossbuild
自动构建

crossbuild 镜像详细信息

crossbuild 镜像标签列表

crossbuild 镜像使用说明

crossbuild 镜像拉取命令

Docker 镜像加速服务

轩辕镜像平台优势

镜像下载指南

相关 Docker 镜像推荐

多架构交叉构建/编译环境,用于生成多架构二进制文件
47 收藏0 次下载activemultiarch镜像

crossbuild 镜像详细说明

crossbuild 使用指南

crossbuild 配置说明

crossbuild 官方文档

crossbuild

🌍 多架构交叉编译环境

![Build Status]([***]

![]([***]

概述

这是一个多架构Docker构建环境镜像,可用于为多种架构生成二进制文件。

支持的目标架构

架构三元组别名linuxosxwindows
x86_64-linux-gnu(默认), linux, amd64, x86_64X
arm-linux-gnueabiarm, armv5X
arm-linux-gnueabihfarmhf, armv7, armv7lX
aarch64-linux-gnuarm64, aarch64X
mipsel-linux-gnumips, mipselX
powerpc64le-linux-gnupowerpc, powerpc64, powerpc64leX
x86_64-apple-darwinosx, osx64, darwin, darwin64X
x86_64h-apple-darwinosx64h, darwin64h, x86_64hX
i386-apple-darwinosx32, darwin32X
x86_64-w64-mingw32windows, win64X
i686-w64-mingw32win32X

使用crossbuild

x86_64

console
$ docker run --rm -v $(pwd):/workdir multiarch/crossbuild make helloworld
cc helloworld.c -o helloworld
$ file helloworld
helloworld: ELF 64-bit LSB  executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=9cfb3d5b46cba98c5aa99db67398afbebb270cb9, not stripped

其他:使用cc而非make

console
$ docker run --rm -v $(pwd):/workdir multiarch/crossbuild cc test/helloworld.c

arm

console
$ docker run --rm -v $(pwd):/workdir -e CROSS_TRIPLE=arm-linux-gnueabi multiarch/crossbuild make helloworld
cc     helloworld.c   -o helloworld
$ file helloworld
helloworld: ELF 32-bit LSB  executable, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=c8667acaa***e05ddb9f67a5e48a337c80bc9, not stripped

armhf

console
$ docker run --rm -v $(pwd):/workdir -e CROSS_TRIPLE=arm-linux-gnueabihf multiarch/crossbuild make helloworld
cc     helloworld.c   -o helloworld
$ file helloworld
helloworld: ELF 32-bit LSB  executable, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=ad507da0b9aeb78e7b824692d4bae6b2e6084598, not stripped

powerpc 64-bit el

console
$ docker run --rm -v $(pwd):/workdir -e CROSS_TRIPLE=powerpc64le-linux-gnu multiarch/crossbuild make helloworld
cc     helloworld.c   -o helloworld
$ file helloworld
helloworld: ELF 64-bit LSB  executable, 64-bit PowerPC or cisco 7500, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=035c50a8b410361d3069f77e2ec2454c70a140e8, not stripped

arm64

console
$ docker run --rm -v $(pwd):/workdir -e CROSS_TRIPLE=aarch64-linux-gnu multiarch/crossbuild make helloworld
cc     helloworld.c   -o helloworld
$ file helloworld
helloworld: ELF 64-bit LSB  executable, ARM aarch64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 3.7.0, BuildID[sha1]=dce6100f0bc***bc***f3cc04bd550d60, not stripped

mips el

console
$ docker run --rm -v $(pwd):/workdir -e CROSS_TRIPLE=mipsel-linux-gnu multiarch/crossbuild make helloworld
cc     helloworld.c   -o helloworld
$ file helloworld
helloworld: ELF 32-bit LSB  executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=d6b2f608a3c1a56b8b990be66eed0c41baaf97cd, not stripped

darwin i386

console
$ docker run -it --rm -v $(pwd):/workdir -e CROSS_TRIPLE=i386-apple-darwin  multiarch/crossbuild make helloworld
o32-clang     helloworld.c   -o helloworld
$ file helloworld
helloworld: Mach-O executable i386

darwin x86_64

console
$ docker run -it --rm -v $(pwd):/workdir -e CROSS_TRIPLE=x86_64-apple-darwin  multiarch/crossbuild make helloworld
o64-clang     helloworld.c   -o helloworld
$ file helloworld
helloworld: Mach-O 64-bit executable x86_64

windows i386

console
$ docker run -it --rm -v $(pwd):/workdir -e CROSS_TRIPLE=i686-w64-mingw32  multiarch/crossbuild make helloworld
o32-clang     helloworld.c   -o helloworld
$ file helloworld
helloworld: PE32 executable (console) Intel 80386, for MS Windows

windows x86_64

console
$ docker run -it --rm -v $(pwd):/workdir -e CROSS_TRIPLE=x86_64-w64-mingw32  multiarch/crossbuild make helloworld
o64-clang     helloworld.c   -o helloworld
$ file helloworld
helloworld: PE32+ executable (console) x86-64, for MS Windows

在Dockerfile中使用crossbuild

Dockerfile
FROM multiarch/crossbuild
RUN git clone [***]
ENV CROSS_TRIPLE=x86_64-apple-darwin
WORKDIR /workdir/objective-c-hello-world
RUN crossbuild ./compile-all.sh

使用crossbuild的项目

  • scaleway/initrd
  • multiarch/build-xnbd-client-static
  • tencherry10/til

致谢

本项目受Steeve Morin的cross-compiler启发。

***说明

OSX/Darwin/Apple构建:
请在继续之前确保您已阅读并理解Xcode许可条款。

许可证

MIT

用户好评

来自真实用户的反馈,见证轩辕镜像的优质服务

oldzhang的头像

oldzhang

运维工程师

Linux服务器

5

"Docker加速体验非常流畅,大镜像也能快速完成下载。"