Code Monkey home page Code Monkey logo

dockerforopenwrtbuild's Introduction

DockerForOpenWrtBuild

Setup Docker

Install docker from the link https://docs.docker.com/engine/install/ubuntu/

Instead you can also install from following commands

sudo apt-get update
sudo apt-get install ca-certificates curl gnupg lsb-release
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
 "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
 $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin

Run following command to add current user to docker group.

sudo usermod -a -G docker $(id -un)

Reboot computer for above command to take effect.

The above command removes the necessity for sudo when running docker command.

Setup image:

Clone this repo and enter the repo in the terminal

Copy your host gitconfig, or create a stripped down version

cp ~/.gitconfig gitconfig

Build docker image

docker build --build-arg userid=$(id -u) --build-arg groupid=$(id -g) --build-arg username=$(id -un) -t openwrt-build-env-base .

Create docker container from the image generated from above command

docker run --name openwrt-build -v <host computer repos directory path>:/home/$(id -un)/repos openwrt-build-env-base &

This docker file creates a user in the image with the same details of user of host computer when built. Set password for the created user in the root shell. To get root shell of the docker container, please use following command

docker exec -it openwrt-build bash

You can get the user shell of running container with the following to start your build

docker exec -it -u $(id -u):$(id -g) openwrt-build

dockerforopenwrtbuild's People

Contributors

nishu0f0 avatar

Watchers

 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.