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

相关推荐
Vallelonga40 分钟前
Rust 中 unsafe 关键字的语义
开发语言·rust
小杍随笔2 小时前
【Rust 1.96.0 深度解析:让 Range 可 Copy、让断言更聪明、让 Wasm 更安全】
安全·rust·wasm
lpfasd1232 小时前
Mise 安装与配置避坑全攻略
rust
星秀日1 天前
rust学习入门
开发语言·学习·rust
mCell1 天前
我把默认的 code . 换成了 zed .
rust·visual studio code·trae
Rust研习社1 天前
MSRV 是什么?一文说清楚
后端·rust·编程语言
特立独行的猫a1 天前
Rust+ Tauri实现漂亮小巧的Mqtt客户端工具--AtomMQTT Client 实现详解
开发语言·后端·mqtt·rust
咸甜适中1 天前
rust语言学习笔记Trait(十三)Borrow、BorrowMut(借用)
笔记·学习·rust