Search code examples
dockerdockerfileopenwrt

How to run openwrt image as a docker image


I'm new to docker. What I want to do is run an openwrt bin file inside a docker container and compile socketman source inside that docker image. this is the image file http://download.gl-inet.com.s3.amazonaws.com/firmware/b1300/v1/qsdk-b1300-2.272.bin


Solution

  • I wanted to compile some source(socketman) to openwrt. Here is my work around.

    I downloaded the sdk for appropriate firmware. (There is the bin file and also the SDK.)

    If you have sdk then you dont have to build the toolchain. tools are already there. (If you get SDK then the build process faster other than compiling whole firmware)

    Then cd into the sdk directory. place your source code inside the package directory.

    then in the terminal (inside the appropriate SDK folder) type make menuconfig

    enter image description here

    Then star the package you want to build save and exit

    then type make if you want to log out the debug info type make -j4 V=s -j4 means the available # of cors, you can put the # of cores that you have on your computer.nproc

    If you want to build inside a docker container.

    install docker

    then clone ubuntu docker image

    run the docker image with interactive shell

    git clone or wget SDK folder into the docker container

    then proceed all the above steps.