Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| docs:guide-user:virtualization:obtain.firmware.docker [2023/03/02 12:54] – add docker build instructoins oliv3r | docs:guide-user:virtualization:obtain.firmware.docker [2024/09/25 17:09] (current) – symlink already present with latest alpine image and py3-distutils-extra is missing as was deprecated https://peps.python.org/pep-0632/ aivaras-s | ||
|---|---|---|---|
| Line 4: | Line 4: | ||
| You can use a premade [[https:// | You can use a premade [[https:// | ||
| - | * [[https://gitlab.com/ | + | * [[https://github.com/ |
| * [[https:// | * [[https:// | ||
| * [[https:// | * [[https:// | ||
| Line 11: | Line 11: | ||
| ===== Building OpenWRT using Docker ====== | ===== Building OpenWRT using Docker ====== | ||
| - | First, an image needs to be obtained. Lets start with the most basic example, where a custom container is build. This can be skipped by instead pulling one of the OpenWRT containers from a container | + | First, an image needs to be obtained. Lets start with the most basic example, where a custom container is build. This can be skipped by instead pulling one of the OpenWRT containers from a container |
| <hidden Alpine Container>< | <hidden Alpine Container>< | ||
| Line 57: | Line 57: | ||
| ' | ' | ||
| ' | ' | ||
| + | ' | ||
| && \ | && \ | ||
| - | ln -s '/ | ||
| addgroup ' | addgroup ' | ||
| adduser -s '/ | adduser -s '/ | ||
| Line 98: | Line 98: | ||
| </ | </ | ||
| - | After placing (either) downloading either/both of these files, a OpenWRT repository is needed. After cloning or downloading the OpenWRT repository it might be a thought to create a dedicated worktree, when not wanting to build using master. | + | After placing (either) downloading either/both of these files, a OpenWRT repository is needed. After cloning or downloading the OpenWRT repository it might be a thought to create a dedicated worktree, when not wanting to build using master. |
| - | Next, the container is to be built, using either | + | Next, the container is to be built, using either |
| Note, while not strictly necessary, we don't want to copy all of the repository files into the container context. Doing so won't hurt or break anything, but it wastes space and costs time and won't even be accessible when running the container. | Note, while not strictly necessary, we don't want to copy all of the repository files into the container context. Doing so won't hurt or break anything, but it wastes space and costs time and won't even be accessible when running the container. | ||
| - | To avoid copying needless files, a `.dockerignore` file is used, which can be either in the same location as the Dockerfile or in the current working directory. | + | To avoid copying needless files, a //.dockerignore// file is used, which can be either in the same location as the //Dockerfile// or in the current working directory. |
| - | ``` | + | < |
| echo " | echo " | ||
| - | ``` | + | </ |
| Building the container is as simple as: | Building the container is as simple as: | ||
| - | ``` | + | < |
| docker build --rm --tag openwrt: | docker build --rm --tag openwrt: | ||
| - | ``` | + | </ |
| The tag can be named whatever of course, dated or likewise. The container only occasionally has to be rebuild, when 'host dependencies' | The tag can be named whatever of course, dated or likewise. The container only occasionally has to be rebuild, when 'host dependencies' | ||
| Finally, the container can be used to launch a build environment | Finally, the container can be used to launch a build environment | ||
| - | ``` | + | < |
| docker run --interactive --rm --tty --ulimit ' | docker run --interactive --rm --tty --ulimit ' | ||
| < | < | ||
| - | ``` | + | </ |
| From here, any normal OpenWRT command can be used as expected (`make menuconfig` etc). It is recommended to create an alias such as | From here, any normal OpenWRT command can be used as expected (`make menuconfig` etc). It is recommended to create an alias such as | ||
| - | `alias make=' | + | < |
| ===== OpenWrt Cloud Builder API ===== | ===== OpenWrt Cloud Builder API ===== | ||