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

相关推荐
qwsaedca1 小时前
在Mac上跑 Kokoro TTS经验总结
rust·mac·tts
qwsaedca1 小时前
Kokoro TTS v1.1 voices 文件格式逆向分析
rust
老猿讲编程4 小时前
【Eclipse OpenSOVD学习之五】拓扑引擎(Topology)
学习·rust·eclipse·sovd
object not found4 小时前
Nuxt4去掉body中默认的边距
开发语言·后端·rust
梦醒沉醉20 小时前
4、Rust参考手册——Crate和源文件
rust
chainbees20 小时前
Windows 系统 Rust 运行环境搭建
rust
k4m7v2pz1 天前
从 Python 搬到 Rust:pyglet MIDI DAW 变成 egui 鬼畜采样器的迁移复盘
开发语言·python·rust
小灰灰搞电子1 天前
Rust+Slint 实现ModbusRTU从机调试助手源码分享
开发语言·rust·modbusrtu
Source.Liu1 天前
Tauri 2.0 + Alpine.js 起步笔记(零构建方案)
rust