multiarch/crossbuild🌍 多架构交叉编译环境
, linux, amd64, x86_64 | X | ||
| arm-linux-gnueabi | arm, armv5 | X | ||
| arm-linux-gnueabihf | armhf, armv7, armv7l | X | ||
| aarch64-linux-gnu | arm64, aarch64 | X | ||
| mipsel-linux-gnu | mips, mipsel | X | ||
| powerpc64le-linux-gnu | powerpc, powerpc64, powerpc64le | X | ||
| x86_64-apple-darwin | osx, osx64, darwin, darwin64 | X | ||
| x86_64h-apple-darwin | osx64h, darwin64h, x86_64h | X | ||
| i386-apple-darwin | osx32, darwin32 | X | ||
| x86_64-w64-mingw32 | windows, win64 | X | ||
| i686-w64-mingw32 | win32 | X |
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
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
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
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
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
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
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
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
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
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
DockerfileFROM multiarch/crossbuild RUN git clone [***] ENV CROSS_TRIPLE=x86_64-apple-darwin WORKDIR /workdir/objective-c-hello-world RUN crossbuild ./compile-all.sh
本项目受Steeve Morin的cross-compiler启发。
OSX/Darwin/Apple构建:
请在继续之前确保您已阅读并理解Xcode许可条款。
MIT
探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
无需登录使用专属域名
Kubernetes 集群配置 Containerd
K3s 轻量级 Kubernetes 镜像加速
VS Code Dev Containers 配置
Podman 容器引擎配置
HPC 科学计算容器配置
ghcr、Quay、nvcr 等镜像仓库
Harbor Proxy Repository 对接专属域名
Portainer Registries 加速拉取
Nexus3 Docker Proxy 内网缓存
需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单
manifest unknown
no matching manifest(架构)
TLS 证书失败
DNS 超时
410 Gone 排查
402 与流量用尽
401 认证失败
429 限流
D-Bus 凭证提示
413 与超大单层
来自真实用户的反馈,见证轩辕镜像的优质服务