【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 的

相关推荐
花褪残红青杏小3 小时前
Rust图像处理第21节-最小二乘回归:用矩阵求逆解"拟合"问题
rust·webassembly·图形学
k4m7v2pz8 小时前
Bevy 0.14.2 玩家精灵不渲染(只有背景在动)排查全记录
macos·rust·bevy
老王生涯10 小时前
rust开发环境配置-Windows & GNU
开发语言·windows·rust
Yeauty10 小时前
自建 HLS 第一问:fMP4 还是 TS?用 Rust 在进程内把两种都跑出来
开发语言·后端·rust
Flynt11 小时前
我用Biome替换ESLint+Prettier在项目上踩了不少坑
rust·eslint·前端工程化
Yeauty11 小时前
2026 年在 Rust 里处理音视频,该走哪条路?
rust·ffmpeg·音视频·视频
TDengine (老段)1 天前
TDengine Go 与 Rust 连接器 — 高性能异步访问
大数据·数据库·物联网·golang·rust·时序数据库·tdengine
魔力女仆1 天前
【RUST AI】把 TTS 搬进浏览器:kokoroi-rs 的 WASM 实践
人工智能·rust·wasm
米尔的可达鸭1 天前
UDP 通信深度实验:从 Windows FastPath 到 ICMP 端口不可达的完整排查
windows·websocket·网络协议·rust·udp·wireshark·tcpdump
jinshw1 天前
自己实现GIS配图软件(二)
前端·后端·rust