Skip to content

feat(offload): ship LICENSE and THIRD-PARTY-NOTICES in packages - #606

Merged
vvoland merged 1 commit into
docker:mainfrom
nicksieger:offload-notices
Nov 23, 2026
Merged

vvoland merged 1 commit into
docker:mainfrom
nicksieger:offload-notices

Conversation

@nicksieger

Copy link
Copy Markdown
Member

Problem

The Offload packages do not include THIRD-PARTY-NOTICES. The deb and rpm packages do not include LICENSE either. docker/cloud#694 generates the notices at release time and attaches them to the release, but nothing in the packaging recipes copies them into a package.

Changes

  • pkg/offload/Dockerfile: new notices named context, mounted in the static, deb and rpm builders. The caller passes a directory with THIRD-PARTY-NOTICES at its root, like the src context. There is no fallback, so the build fails without the file.
  • Static: pkg-static-build.sh copies THIRD-PARTY-NOTICES into the archive's doc/ next to LICENSE and README.md.
  • deb: rules installs LICENSE and THIRD-PARTY-NOTICES into /usr/share/doc/docker-offload-plugin/. deb/copyright points to them.
  • rpm: the spec installs both files and lists them with %license. pkg-rpm-build.sh defines _noticesdir.
  • pkg-deb-build.sh and pkg-rpm-build.sh fail early when LICENSE or the notices file is missing or empty.
  • verify.Dockerfile checks that both files are in each static archive, deb and rpm. For deb and rpm it reads the package contents, because some base images exclude /usr/share/doc.
  • docker-bake.hcl: the comment on _pkg-offload lists the notices context.

Merge order

Every Offload build fails until docker/cloud passes the notices context, including the Linux packages. The docker/cloud change sets pkg-offload-${DISTRO}.contexts.notices to its values/ directory and moves PACKAGING_REF to the merge commit of this PR. Merge this first.

Not checked

  • No stage, deb or rpm has been built. The Offload targets exist only through the docker/cloud override, so docker buildx bake --print cannot show them here.
  • The rpm %license entries use paths relative to the build directory, as the other specs do. This is not run.
  • The LICENSE text and the deb copyright wording are placeholders until compliance answers on DCL-2316.

🤖 Generated with Claude Code

@nicksieger
nicksieger requested a review from a team as a code owner November 23, 2026 17:22

@vvoland vvoland left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One blocker, LGTM otherwise

Comment thread pkg/offload/deb/rules
override_dh_auto_install:
install -D -p -m 0755 $(CURDIR)/offload/dist/docker-offload debian/docker-offload-plugin/usr/libexec/docker/cli-plugins/docker-offload
install -D -p -m 0644 $(CURDIR)/offload/LICENSE debian/docker-offload-plugin/usr/share/doc/docker-offload-plugin/LICENSE
install -D -p -m 0644 $(CURDIR)/notices/THIRD-PARTY-NOTICES debian/docker-offload-plugin/usr/share/doc/docker-offload-plugin/THIRD-PARTY-NOTICES

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My agent flagged this:

dh_compress will gzip THIRD-PARTY-NOTICES, so the deb check fails**

  • deb/rules installs THIRD-PARTY-NOTICES and LICENSE into usr/share/doc/docker-offload-plugin/, then runs the default dh sequence.
  • In that sequence, dh_compress gzips any file in usr/share/doc larger than 4k, except copyright, web files and images. I checked this against the debhelper source on salsa.
  • A notices file for a Go plugin's dependencies will be well over 4k, so the package will contain THIRD-PARTY-NOTICES.gz. LICENSE may end up as .gz too, depending on its final text.
  • The verify.Dockerfile greps use .../THIRD-PARTY-NOTICES$, so the deb verify step fails, which then fails the release.
  • Fix either side:
    • Keep the files uncompressed. That's probably better for a compliance file. Add this to rules:
      override_dh_compress:
      	dh_compress -X LICENSE -X THIRD-PARTY-NOTICES
      
    • Or accept the Debian convention and make both greps match (\.gz)?$.

- add `notices` named context holding the release THIRD-PARTY-NOTICES
- static: copy THIRD-PARTY-NOTICES into archive doc/, fail without it
- deb: install LICENSE and notices under /usr/share/doc, point copyright at them
- rpm: %license LICENSE and THIRD-PARTY-NOTICES
- verify: check the files in the static archives, debs and rpms
- dh_compress gzips usr/share/doc files over 4k, which breaks the verify check
- exclude both files from dh_compress

Signed-off-by: Nick Sieger <nick@nicksieger.com>
@vvoland
vvoland merged commit df55d1c into docker:main Nov 23, 2026
1488 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants