Sign inSign up

cnrock/openwrt-build-env

By cnrock

•Updated over 4 years ago

0

163

cnrock/openwrt-build-env repository overview

⁠openwrt-build-env fork from github.com/P3TERX/openwrt-build-env

⁠build for arm64 arch.

LICENSE Docker Stars Docker Pulls

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 cnrock/openwrt-build-env:arm64
    
  • Build image.

    docker build -t cnrock/openwrt-build-env:arm64 github.com/P3TERX/openwrt-build-env
    
⁠Run container
docker run \
    -itd \
    --name openwrt-build-env \
    -h cnrock \
    -p 10022:22 \
    -v ~/openwrt:/home/user/openwrt \
    cnrock/openwrt-build-env:arm64
⁠Set the mount directory file permissions
  • 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

Tag summary

Content type

-

Digest

Size

385 MB

Last updated

over 4 years ago

docker pull cnrock/openwrt-build-env:arm64