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

相关推荐
SomeB1oody2 小时前
【RustyML入门】6.0. 数学工具
开发语言·后端·机器学习·rust·教程
今天AI了吗8 小时前
从聊天到委派:AI Agent 如何推进长期任务
数据库·人工智能·python·sql·rust
梦醒沉醉11 小时前
std1.97.1——fmt模块总览
rust
SomeB1oody12 小时前
【RustyML入门】5.3. 聚类指标
开发语言·后端·机器学习·rust·教程
雾沉川13 小时前
Rust IDE 选型:除 VS Code 之外,RustRover 非商业场景可免费使用
ide·vscode·rust
特立独行的猫a13 小时前
Rust + Tauri实现一棵「习惯树」:创意应用 从 Grove 的灵感说起
开发语言·后端·rust·tauri·习惯树·创意应用
程序员爱钓鱼14 小时前
Go 编程实战:Map——使用 Key-Value 管理键值数据
后端·rust·go
程序员爱钓鱼15 小时前
Rust Trait Object详解:dyn Trait与动态分发
后端·面试·rust
蒜香可达鸭1 天前
Grok-build: Rust 工程实践分析
rust
SomeB1oody1 天前
【RustyML入门】5.2. 分类指标
开发语言·后端·机器学习·rust·教程