Giter VIP home page Giter VIP logo

openwrt-build-env's Introduction

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

openwrt-build-env's People

Contributors

p3terx avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.