Commit Graph

216 Commits (main)

Author SHA1 Message Date
George Sapkin c0ddfae186 README.md: add clearer ImageBuilder examples using Docker and Podman
Document building firmware using Docker or Podman with one-liners, including
snapshot support.

Signed-off-by: George Sapkin <george@sapk.in>
2026-08-18 15:24:11 +02:00
dependabot[bot] e077925f1d build(deps): Bump actions/checkout from 6 to 7
Bumps [actions/checkout](https://github.com/actions/checkout) from 6 to 7.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-17 23:05:46 +02:00
Josef Schlehofer 09ba01ec8a ci: rebuild branch containers on a schedule
The rootfs, sdk and imagebuilder containers for the release branches
are only rebuilt when someone triggers containers.yml by hand. The
-openwrt-24.10 tags on Docker Hub were last pushed in December 2025
with kernel 6.6.119 baked in, while the 24.10-SNAPSHOT feeds have
moved on to 6.6.151, so every runtime test in the packages CI fails
with a 404 on the kmods feed.

Add a schedule trigger: a scheduled run only dispatches the workflow
for main and the maintained release branches and skips the build
jobs. Going through workflow_dispatch keeps scheduled runs identical
to manual ones, since a schedule event carries no ref input and the
rest of the workflow is driven by it. GITHUB_TOKEN may create
workflow_dispatch events, so no extra secrets are needed.
2026-08-17 11:51:14 +02:00
dependabot[bot] ed4440d510 build(deps): Bump docker/login-action from 3 to 4
Bumps [docker/login-action](https://github.com/docker/login-action) from 3 to 4.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-17 10:43:11 +02:00
dependabot[bot] 1b06582a6c build(deps): Bump docker/build-push-action from 6 to 7
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 6 to 7.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v6...v7)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-17 09:49:52 +02:00
dependabot[bot] 731f8291a1 build(deps): Bump docker/metadata-action from 5 to 6
Bumps [docker/metadata-action](https://github.com/docker/metadata-action) from 5 to 6.
- [Release notes](https://github.com/docker/metadata-action/releases)
- [Commits](https://github.com/docker/metadata-action/compare/v5...v6)

---
updated-dependencies:
- dependency-name: docker/metadata-action
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-17 09:48:16 +02:00
dependabot[bot] 3c2e773a0f build(deps): Bump docker/setup-buildx-action from 3 to 4
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 3 to 4.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-17 09:48:03 +02:00
Josef Schlehofer bef4dc0a41 README: document GitHub Actions registry secrets configuration 2026-08-17 09:43:22 +02:00
Josef Schlehofer 9d03179841 ci: make Docker Hub and Quay.io registries optional and dynamic
Currently, the workflow attempts to log in and push to the official openwrt namespaces on Docker Hub and Quay.io unconditionally on all non-pull-request events. This causes errors on repository forks where these credentials are not set.

This change makes the Docker Hub and Quay.io steps conditional on their respective secrets being non-empty. Additionally, the target repository namespace paths are dynamically derived from the secrets (or from the github.repository_owner in case of GHCR), allowing forks to optionally push to their own Docker Hub or Quay.io accounts if they set up the credentials.
2026-08-17 09:43:22 +02:00
Maxim Skokov f673c56eaf Dockerfile.rootfs: drop dangling /etc/resolv.conf symlink
The rootfs image ships /etc/resolv.conf as a symlink to /tmp/resolv.conf.
In a build context /tmp is empty, so the symlink dangles and older buildkit
fails any RUN step on the image with:

  make mountpoint "/etc/resolv.conf": file exists

when it tries to bind-mount the build-time resolv.conf over it. Docker
injects its own /etc/resolv.conf at runtime regardless, so the shipped
symlink serves no purpose in the container image. Remove it in the builder
stage before it is copied into the final scratch image.

Verified with `docker save` that no layer contains etc/resolv.conf after the
change, and that DNS still resolves at runtime via Docker's mounted
resolv.conf (nslookup downloads.openwrt.org succeeds).

Fixes: https://github.com/openwrt/docker/issues/191
Signed-off-by: Maxim Skokov <skokov.m020709@gmail.com>
2026-08-17 09:41:15 +02:00
Josef Schlehofer fb30fc3180 ci: fix DOWNLOAD_FILE expansion for rootfs builds
f6d7df9 ("ci: select only correct targz for rootfs build") builds the
rootfs archive name with ${TARGET//\//-}, but the heredoc generating
the build args is single-quoted, so the substitution never happens.
The literal openwrt-${TARGET_TAG}-rootfs.tar.gz then reaches setup.sh.

grep finds no match, leaving file_name empty and causing the
verification to check the entire sha256sums file. Every rootfs job
has since failed with "12414 listed files could not be read".

Expand the target tag in the shell before generating the args, while
keeping DOWNLOAD_FILE as a pattern: release branches embed the
version and revision in the filename, and malta/be has a -default-
profile infix. The pattern must also exclude targz- image variants.

Verified to match exactly one file for all eight rootfs targets on
both snapshots and releases/24.10-SNAPSHOT.

Make setup.sh fail loudly when the pattern matches nothing instead of
producing the misleading checksum error.
2026-08-17 09:34:39 +02:00
Eric Fahlgren f6d7df9305 ci: select only correct targz for rootfs build
Changes to upstream builds now create multiple targz images, so
the current wildcard selections result in multiple values instead
of the single one desired.

Make the image matching specific to the one desired.

Fixes: https://github.com/openwrt/docker/issues/202
Signed-off-by: Eric Fahlgren <ericfahlgren@gmail.com>
2026-07-31 14:08:54 +02:00
Paul Spooren 1164645a5e ci: build one SDK container per target instead of per architecture
Each target has unique base packages, so SDKs need to be built per
target. The first target for each architecture also gets an arch-based
tag as a convenience default.

Tags use dashes instead of slashes (e.g. ath79-generic not ath79/generic)
since Docker tags cannot contain slashes.
2026-02-06 16:09:40 +01:00
Robert Marko d2a2e97b7d README: fix Build Your Own IB example
OpenWrt switched to using ZSTD compressed tarballs a while ago, so using
the current example DOWNLOAD_FILE arg will result in the built container
not being able to find any files since that tarball is missing.

So, update to also look for .tar.zst as well.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-16 12:57:39 +01:00
dependabot[bot] 9c2aa7194e build(deps): Bump actions/checkout from 5 to 6
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-02 10:34:27 +01:00
Paul Spooren 67bc46afd4 ci: s/UPSTREAM_URL/FILE_HOST and use mirror-03 as upstream provider
The job is triggered whenever a new target is uploaded. This happens the same
moment the CDN cache is flushed, so it's possible that there is a flaky
situation where the CDN is half way through purging the cache.

Unify the variables for the upstream URL, in Dockerfile it's called FILE_HOST,
in the setup.sh it's called UPSTREAM_URL. Use FILE_HOST everywhere but fallback
to UPSTREAM_URL if defined.

Let's use our own mirror for this.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2025-08-13 15:32:38 +02:00
Paul Donald 5b55c0301e READMEL: kick-start commands
Conditionally run setup.sh in kick-start command instructions.

If you download a snapshot container it only contains the setup.sh.
Conditioning to the /scripts folder existence means repeatedly executing
the same commands doesn't execute the setup script repeatedly, but only
if it has not yet been run. You skip download steps which have already
been executed. The instructions provided are copy-paste anyway.

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2025-08-13 15:03:25 +02:00
Paul Donald 7a2eace75e README: spell fixes
spelling and grammar

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2025-08-13 15:03:25 +02:00
dependabot[bot] 47d0e61953 build(deps): Bump actions/checkout from 4 to 5
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-13 10:03:10 +02:00
Tom Herbers 4cb14fd558 setup.sh: less verbose wget output
This hides the download progress but is still more verbose then quiet.

This should help not to pollute the logs when downloading the sdk with progress info.

Signed-off-by: Tom Herbers <mail@tomherbers.de>
2025-05-26 11:27:00 +02:00
Stephen Liu 6763baf1c6 typo: should be "put"Link: https://github.com/openwrt/docker/pull/160
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2025-04-05 08:08:17 +00:00
Stephen Liu f327389533 use https prefix on link
Signed-off-by: Stephen Liu <stephen.liu@alumni.stanford.edu>Link: https://github.com/openwrt/docker/pull/160
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2025-04-05 08:08:17 +00:00
Stephen Liu bb4d2df49a fix: update buildbot links
Signed-off-by: Stephen Liu <stephen.liu@alumni.stanford.edu>Link: https://github.com/openwrt/docker/pull/160
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2025-04-05 08:08:17 +00:00
Petr Štetiar 1c462828c0 ci: fix pushing of ImageBuilder containers
Eric reported, that he is having problem with
imagebuilder:mediatek-filogic-master. The issue is caused by refactoring
of Build Push stage in commit cda8065dc5 ("ci: add smoke testing of
SDK and IB containers"), where I forget to enable pushing with `push:
true` input as the default is `push: false`.

So lets fix it by explicitly enabling the push input, while at it unify
the Push stage configs.

Fixes: #167
Fixes: cda8065dc5 ("ci: add smoke testing of SDK and IB containers")
Link: https://github.com/openwrt/docker/pull/168
Reported-by: Eric Fahlgren <ericfahlgren@gmail.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2025-04-05 04:20:22 +00:00
Petr Štetiar 648a9bd5ba
Dockerfile: fix GPG keys permission issues during container setup
Currently the container initial setup using setup.sh fails:

  rm: cannot remove '/builder/keys/88CA59E8.asc': Permission denied
  rm: cannot remove '/builder/keys/CD54E82DADB3684D.asc': Permission denied
  rm: cannot remove '/builder/keys/2074BE7A.asc': Permission denied
  rm: cannot remove '/builder/keys/0x1D53D1877742E911.asc': Permission denied
  rm: cannot remove '/builder/keys/626471F1.asc': Permission denied

That is happening due to PEBKAC, where I didn't realized, that there is
such additional setup.sh happening. So lets fix it by adding the keys
with correct owner.

Link: https://github.com/openwrt/docker/pull/165
References: https://github.com/openwrt/packages/actions/runs/14242829383/job/39916509620?pr=26225
Fixes: #164
Fixes: 79999f3c7e ("Dockerfile: fix rootfs container generation")
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2025-04-03 19:21:04 +00:00
Petr Štetiar cda8065dc5
ci: add smoke testing of SDK and IB containers
Currently we happily accept changes, which might break SDK and/or IB
containers. So lets try to minimize the regressions by adding a smoke
test before pushing the container.

References: #164
Link: https://github.com/openwrt/docker/pull/165
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2025-04-03 19:21:03 +00:00
Petr Štetiar e8012cce6a
ci: fix rootfs container smoke test during push
Currently the Smoke test stage fails in the push event pipeline:

  Run docker run --platform=linux/mips_24kc sha256:d1700df716390394450d4851555b1904fd245c02e79573f6e97b4c24cdaafc8d uname -m
  exec /bin/uname: exec format error
  Error: Process completed with exit code 255.

This is not failing in the pull_request pipeline as the QEMU is properly
configured. So lets fix the push event pipeline by configuring the QEMU
in the same way, so the smoke test can pass.

Fixes: 3724e26fa1 ("ci: only use apt during testing")
Link: https://github.com/openwrt/docker/pull/163
Reference: https://github.com/openwrt/docker/actions/runs/14235928616/job/39895103039#step:10:53
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2025-04-03 06:18:19 +00:00
Petr Štetiar b74469c8e2
ci: fix rootfs container push
Currently the Push stage fails for rootfs containers:

  ERROR: failed to solve: process "/bin/sh -c if [ \"$RUN_SETUP\" -eq 1 ]; then /builder/setup.sh; fi" did not complete successfully: unable to find user root: invalid argument

This is happening as the commit 9999f3c7e58 ("Dockerfile: fix rootfs container generation")
changed the file argument on Build stage, but Push stage was omitted.

So lets fix it now by using working Dockerfile.rootfs.

References: https://github.com/openwrt/docker/actions/runs/14235351624/job/39893588545#step:11:288
Fixes: 79999f3c7e ("Dockerfile: fix rootfs container generation")
Fixes: 9b55784b18 ("BREAKING: use setup.sh instead of Dockerfile")
Link: https://github.com/openwrt/docker/pull/162
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2025-04-03 05:21:53 +00:00
Petr Štetiar 79999f3c7e
Dockerfile: fix rootfs container generation
Currently several rootfs containers are failing to build, as the
buildbot user doesn't exists in those FROM:scratch containers:

  /usr/bin/docker buildx build (snip) --build-arg USER=root --build-arg BASE_IMAGE=scratch (snip)
  ...snip...
  #2 [1/5] ADD --chown=buildbot:buildbot keys/*.asc /builder/keys/
  #2 ERROR: invalid user index: -1

So lets fix it by avoiding need for ownership and simply import the keys
through pipe. Move the gpg key import into setup.sh script as well,
since this is the place where the keys are being used.

Also add a new Dockerfile.rootfs that must be used to generate a rootfs
container as the generic Dockerfile is not able to build the rootfs image.

Fixes: 9b55784b18 ("BREAKING: use setup.sh instead of Dockerfile")
References: https://github.com/openwrt/routing/pull/1107#issuecomment-2768156513
References: https://github.com/openwrt/docker/actions/runs/14165468179/job/39681375639#step:9:243
Link: https://github.com/openwrt/docker/pull/161
Acked-by: Paul Spooren <mail@aparcar.org>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2025-04-03 05:02:09 +00:00
Paul Spooren 22cde2e838 chore(cleanup): remove outdated schedule steps
Those are no longer used and commit 9b55784 "BREAKING: use setup.sh
instead of Dockerfile" cleaned them only half way.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2025-01-09 10:26:59 +01:00
Paul Spooren 342193af45 ci: add missing run_setup output
Signed-off-by: Paul Spooren <mail@aparcar.org>
2024-12-04 11:57:04 +01:00
Paul Spooren ad3f40e465 Dockerfile: fix RUN_SETUP detection
Signed-off-by: Paul Spooren <mail@aparcar.org>
2024-12-04 07:19:28 +01:00
Paul Spooren 71ea35b1e8 Update dependabot.yml
Signed-off-by: Paul Spooren <mail@aparcar.org>
2024-11-06 16:47:58 +01:00
Paul Spooren 954a9ef5c6 keys: add new Nitrokey based key
Find details here:
https://git.openwrt.org/?p=keyring.git;a=commit;h=6b42a5c8b7dc049b899869b2a1b94daf69ceb2f5

Signed-off-by: Paul Spooren <mail@aparcar.org>
2024-11-06 15:35:20 +01:00
Paul Spooren d0c534805d Dockerfile: switch to v21 aka debian:11
We switches to Debian 12 to early, causing incompatible SDK versions.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2024-11-05 20:33:40 +01:00
Paul Spooren 9b55784b18 BREAKING: use setup.sh instead of Dockerfile
Instead of causing infinite amounts of traffic per day, only ship a
preconfigured setup.sh file with SNAPSHOT containers and ask the
downstream user to run `setup.sh` on their own.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2024-11-05 12:48:08 +01:00
Moeta Yuko ad118a4b0e update base image to buildworker 3.11.8
Fixes https://github.com/openwrt/gh-action-sdk/issues/43
2024-11-03 18:52:32 +01:00
Andrey Butirsky 00a38e539f Update README.md: add missing SDK tags
fix #148

Signed-off-by: Andrey Butirsky <butirsky@gmail.com>
2024-10-01 09:21:27 +02:00
Paul Spooren 7d14bdaa7a ci: don't cache docker builds
Signed-off-by: Paul Spooren <mail@aparcar.org>
2024-08-06 15:17:07 +02:00
Paul Spooren 26cae77722 ci: prune after building
Without the cleanup the system is full after a single day...

Signed-off-by: Paul Spooren <mail@aparcar.org>
2024-07-31 18:41:00 +02:00
Paul Spooren 3724e26fa1 ci: only use apt during testing
Real container pushing happens on a device where QEMU is already
installed.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2024-07-31 00:37:06 +02:00
Paul Spooren d629f7ea1a ci: run on docker-builder
Our CI is often heavily overloaded by CI testing jobs, however those
Docker containers shouldn't be delayed by multiple hours. Let's have our
own builder that does nothing but uploading those containers in time.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2024-07-31 00:17:21 +02:00
Moeta Yuko 66519f65d1 ci: use whole word matching for TARGET_FILTER
If the target name is a substring of another (e.g. malta/be and malta/be64),
pushing the current target image will mistakenly override the other one.

Fixes #142
2024-07-25 12:43:08 +02:00
dependabot[bot] 974d1ad86d build(deps): Bump docker/build-push-action from 5 to 6
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 5 to 6.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v5...v6)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-18 14:06:03 +02:00
Paul Spooren 27f2feaf3d ci: add run-name
This should make things prettier

Signed-off-by: Paul Spooren <mail@aparcar.org>
2024-06-17 11:27:07 +02:00
Paul Spooren 4f24894b84 ci: allow to set file_host and prefix
This is nice for creating APK based containers.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2024-06-12 16:46:55 +02:00
Paul Spooren 017ab6488d Support new zstd compressed archives
ImageBuilder and SDK compression switched to zstd due to the recent XZ
backdoor event and overall complexity of the XZ design.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2024-04-15 09:29:37 +02:00
Paul Spooren eba0c3a321 update base image to buildworker 3.11.1
Signed-off-by: Paul Spooren <mail@aparcar.org>
2024-04-15 09:29:37 +02:00
dependabot[bot] cc0afc9373 build(deps): Bump docker/build-push-action from 3 to 5
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 3 to 5.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v3...v5)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-12 20:15:55 +01:00
dependabot[bot] 48f2e09e43 build(deps): Bump docker/login-action from 2 to 3
Bumps [docker/login-action](https://github.com/docker/login-action) from 2 to 3.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-12 20:15:40 +01:00