【Openwrt】M4 Macmini编译Openwrt的Dockerfile

bash 复制代码
fucker@ubuntu ~ % cat Dockerfile

FROM ubuntu:22.04

ENV DEBIAN_FRONTEND=noninteractive
ENV FORCE_UNSAFE_CONFIGURE=1

RUN apt update && apt install -y \
    build-essential git wget curl \
    python3 python3-pip python3-dev python3-setuptools python3-distutils \
    swig \
    bison flex bc gawk \
    device-tree-compiler \
    libssl-dev \
    zlib1g-dev \
    unzip rsync file \
    ncurses-dev \
    xz-utils \
    automake autoconf libtool gettext \
    ccache \
    && rm -rf /var/lib/apt/lists/*

# 克隆 OpenWrt 官方源码
RUN git clone https://github.com/openwrt/openwrt --depth=1 /openwrt

WORKDIR /openwrt

CMD ["/bin/bash"]

构建docker images

bash 复制代码
docker build --platform=linux/arm64 -t openwrt-mt7981 .

编译openwrt,把编译后的img映射到本地

复制代码
fucker@ubuntu /tmp % mkdir openwrt
fucker@ubuntu /tmp % docker run --rm -it --name openwrt-build \
        -v /tmp/openwrt:/openwrt/bin \
        mt7981 \
        bash

注意:

(1) 我以为dockerimages 要装x64的,但是不需要。arm64可以交叉编译x86 的

相关推荐
大卫小东(Sheldon)8 小时前
大模型智能体 (agent)简易流程介绍
ai·rust
小杍随笔10 小时前
【Rust 语言编程知识与应用:同步机制详解】
开发语言·算法·rust
Rust研习社14 小时前
Rust 错误处理:thiserror 和 anyhow 的使用
rust
RE-190114 小时前
Polars:告别 Pandas 性能瓶颈,用 Rust 驱动的 DataFrame 库处理亿级数据
开发语言·rust·pandas·polars·ai生成
好家伙VCC14 小时前
# 发散创新:用 Rust 实现高性能事件驱动架构的实践与优化 在现代软件系统中,**事件驱动编程模型**已经成为构
java·开发语言·python·架构·rust
Ivanqhz15 小时前
寄存器分配的核心函数 allocate
java·开发语言·后端·python·rust
浪客川16 小时前
godot-rust入门案例
rust·游戏引擎·godot
wenlonglanying1 天前
Windows安装Rust环境(详细教程)
开发语言·windows·rust
Rust研习社1 天前
Rust + WebAssembly 新手完全入门指南
rust
Java水解1 天前
Rust异步缓存系统的设计与实现
后端·rust