• This repository has been archived on 02/Mar/2024
  • Stars
    star
    104
  • Rank 329,318 (Top 7 %)
  • Language
    Dockerfile
  • License
    MIT License
  • Created about 5 years ago
  • Updated about 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

OpenWrt build environment in docker | Docker 中的 OpenWrt 编译环境

openwrt-build-env

LICENSE GitHub Stars GitHub Forks Docker Stars Docker Pulls GitHub Workflow Status

OpenWrt build environment in docker.

Read the details in my blog (in Chinese) | 中文教程

Usage

Pull or build image

  • Pull image from docker hub.

    docker pull p3terx/openwrt-build-env
  • Build image.

    docker build -t p3terx/openwrt-build-env github.com/P3TERX/openwrt-build-env

Run container

docker run \
    -itd \
    --name openwrt-build-env \
    -h P3TERX \
    -p 10022:22 \
    -v ~/openwrt:/home/user/openwrt \
    p3terx/openwrt-build-env

Set the mount directory file permissions

  • Enter the id command to check UID and GID

    $ id
    uid=1001(p3terx) gid=1002(p3terx)
  • Modify the UID and GID

    docker exec openwrt-build-env sudo usermod -u 1001 user
    docker exec openwrt-build-env sudo groupmod -g 1002 user
  • Modify the file ownership

    docker exec openwrt-build-env sudo chown -hR user:user .
  • Restart container

    docker restart openwrt-build-env

SSH security settings

The default SSH user name and password is user. If you are making the container accessible from the internet you'll probably want to secure it bit. You can do one of the following two things after launching the container:

  • Change password:

    docker exec -it openwrt-build-env sudo passwd user
  • Don't allow passwords at all, use keys instead:

    docker cp ~/.ssh/authorized_keys openwrt-build-env:/home/user/.ssh
    docker exec openwrt-build-env sudo chown user:user /home/user/.ssh/authorized_keys
    docker exec openwrt-build-env sudo sed -i '/PasswordAuthentication /c\PasswordAuthentication no' /etc/ssh/sshd_config
    docker restart openwrt-build-env

Enter container

  • Enter from the host.

    docker exec -it openwrt-build-env zsh
  • Connect via SSH.

    ssh user@IP -p 10022

Clone source code and build

git clone https://github.com/openwrt/openwrt
cd openwrt
./scripts/feeds update -a
./scripts/feeds install -a
make menuconfig
make download -j8
make V=s

More Repositories

1

Actions-OpenWrt

A template for building OpenWrt with GitHub Actions | 使用 GitHub Actions 在线云编译 OpenWrt 固件
Shell
6,919
star
2

warp.sh

Cloudflare WARP Installer | WARP 一键安装脚本
Shell
3,571
star
3

aria2.conf

Aria2 配置文件 | OneDrive & Google Drvive 离线下载 | 百度网盘转存
Shell
3,079
star
4

Aria2-Pro-Docker

Aria2 Pro | A perfect Aria2 Docker image | 更好用的 Aria2 Docker 容器镜像
Dockerfile
2,919
star
5

aria2.sh

Aria2 一键安装管理脚本 增强版
Shell
2,789
star
6

GeoLite.mmdb

MaxMind's GeoIP2 GeoLite2 Country, City, and ASN databases
1,518
star
7

Aria2-Pro-Core

Aria2 static binaries for GNU/Linux with some powerful feature patches. | 破解无限线程 防掉线程优化 静态编译 二进制文件 增强版
Shell
367
star
8

IBM-CF-V2

Use GitHub Actions to automatically deploy the latest version of V2Ray to IBM Cloud Foundry
206
star
9

ServerStatus-V

云探针、多服务器探针、云监控、多服务器云监控
C
101
star
10

ssh2actions

Connect to GitHub Actions VM via SSH for interactive debugging
Shell
84
star
11

wireguard-go-builder

Compiling the wireguard-go binary from source. With this binary, users are able to create WireGuard sessions without installing the kernel module.
Shell
66
star
12

SSH_Key_Installer

Install SSH keys via GitHub, URL or local files
Shell
65
star
13

script

Some shell script
Shell
54
star
14

ActionsVM

Connect to GitHub Actions via SSH, get macOS or Linux VM for free.
Shell
40
star
15

unraid-docker-templates

Templates for adding containers to UNRAID via more GUI-friendly way and allowing easier updates in the future.
26
star
16

goindex_backup

Google Drive Directory Index backup
JavaScript
17
star
17

doubi_backup

Shell
11
star
18

openwrt-list

10
star
19

P3TERX

8
star
20

BestTrace

Shell
5
star
21

ca-certificates.crt

Make ca-certificates.crt daily via GitHub Actions
Shell
5
star
22

termux.sh

Shell
4
star
23

ariang

3
star
24

ubuntu-plus

Ubuntu image with some extra packages
Dockerfile
3
star
25

Gitpod-OpenWrt

OpenWrt build environment in Gitpod
Dockerfile
2
star