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 [2018/03/03 20:55] – ↷ Page moved from docs:user-guide:virtualization:obtain.firmware.docker to docs:guide-user:virtualization:obtain.firmware.docker bobafetthotmail | 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 1: | Line 1: | ||
| ====== Docker OpenWrt Image Generation ====== | ====== Docker OpenWrt Image Generation ====== | ||
| + | |||
| + | See also [[docs: | ||
| You can use a premade [[https:// | You can use a premade [[https:// | ||
| + | * [[https:// | ||
| * [[https:// | * [[https:// | ||
| + | * [[https:// | ||
| * //wlan slovenija// [[https:// | * //wlan slovenija// [[https:// | ||
| + | * Roll your own using either Alpine or Debian containerfiles. | ||
| + | |||
| + | ===== 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 registry. | ||
| + | |||
| + | <hidden Alpine Container>< | ||
| + | FROM docker.io/ | ||
| + | |||
| + | ENV GCC_COLORS=' | ||
| + | WORKDIR /workdir | ||
| + | |||
| + | RUN apk add --no-cache \ | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | && \ | ||
| + | addgroup ' | ||
| + | adduser -s '/ | ||
| + | |||
| + | USER buildbot | ||
| + | </ | ||
| + | |||
| + | <hidden Debian Container>< | ||
| + | FROM docker.io/ | ||
| + | |||
| + | ENV GCC_COLORS=' | ||
| + | WORKDIR /workdir | ||
| + | |||
| + | RUN apt-get update && apt-get install --no-install-recommends --no-install-suggests --yes \ | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | && \ | ||
| + | rm -f -r '/ | ||
| + | rm -f -r '/ | ||
| + | useradd -m -s '/ | ||
| + | |||
| + | USER buildbot | ||
| + | </ | ||
| + | |||
| + | 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 **podman** or **docker**. | ||
| + | |||
| + | 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 // | ||
| + | |||
| + | < | ||
| + | echo " | ||
| + | </ | ||
| + | |||
| + | Building the container is as simple as: | ||
| + | < | ||
| + | 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' | ||
| + | |||
| + | Finally, the container can be used to launch a build environment | ||
| + | < | ||
| + | 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 | ||
| + | < | ||
| ===== OpenWrt Cloud Builder API ===== | ===== OpenWrt Cloud Builder API ===== | ||
| Line 11: | Line 131: | ||
| ===== Project specific OpenWrt Buildroot ===== | ===== Project specific OpenWrt Buildroot ===== | ||
| - | To facilitate sharing an project specific | + | To facilitate sharing an project specific |
| - | https:// | + | [[https:// |