Skip to content

build: include LICENSE in gateway and event-gateway images#1969

Merged
renuka-fernando merged 2 commits into
wso2:mainfrom
renuka-fernando:licence
May 14, 2026
Merged

build: include LICENSE in gateway and event-gateway images#1969
renuka-fernando merged 2 commits into
wso2:mainfrom
renuka-fernando:licence

Conversation

@renuka-fernando

@renuka-fernando renuka-fernando commented May 14, 2026

Copy link
Copy Markdown
Contributor

Purpose

The gateway and event-gateway Docker images did not ship the Apache License 2.0 text, which is required for distribution compliance.

Approach

  • Stage the repo-root LICENSE into each image's /app/LICENSE via the existing target/ build-context pattern.
  • Cover both regular and multi-arch builds (plus the debug and coverage variants):
    • gateway/gateway-runtime, gateway/gateway-controller, gateway/gateway-builder
    • event-gateway/gateway-runtime, event-gateway-controller
  • Add a target/ build-context to gateway-controller and gateway-builder (which previously didn't use one) and clean it up after each build where appropriate.
  • Gitignore the newly introduced gateway/gateway-controller/target/, gateway/gateway-builder/target/, and event-gateway/gateway-runtime/target/ directories.
  • Templated Dockerfiles (built from these base images by gateway-builder) inherit /app/LICENSE automatically, so no template changes were needed.

Related Issues

Fixes #1968

Test environment

Verified after building locally and running via docker compose / docker run:

Gateway Controller

❯ docker compose exec -it gateway-controller bash
wso2@be61b38e43e2:/app$ ls
LICENSE  build-manifest.yaml  certificates  controller  data  default-llm-provider-templates  default-policies  listener-certs  lua
wso2@be61b38e43e2:/app$ head LICENSE
                                 Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

Gateway Runtime

❯ docker compose exec -it gateway-runtime bash
wso2@ca2aade32695:/$ cd app/
wso2@ca2aade32695:/app$ ls
LICENSE  build-manifest.yaml  policy-engine  python-executor  python-libs  python-requirements-lock.txt
wso2@ca2aade32695:/app$ head LICENSE
                                 Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

Gateway Builder

❯ docker run -it --rm --entrypoint  bash ghcr.io/wso2/api-platform/gateway-builder:1.2.0-SNAPSHOT
root@c2b39236c275:/workspace# cd /app
root@c2b39236c275:/app# ls
LICENSE
root@c2b39236c275:/app# head LICENSE
                                 Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

Documentation

N/A — no doc impact; this is a packaging change to embed the existing repo-root LICENSE in the published images.

Automation tests

  • Unit tests: N/A — build-system change only, no code paths affected.
  • Integration tests: N/A — verified manually by inspecting the built images (see Test environment).

Security checks

Samples

N/A

Related PRs

N/A

Stage the repo-root LICENSE into each image's /app/LICENSE via the
target/ build-context pattern across both regular and multi-arch
builds (and debug/coverage variants).

- gateway/gateway-runtime, gateway-controller
- event-gateway/gateway-runtime, event-gateway-controller
- add target/ build-context to gateway-controller (was absent)
- gitignore the new gateway-controller and event-gateway-runtime
  target/ dirs

Templated Dockerfiles inherit /app/LICENSE from the updated base
images, so no template changes are needed.
@coderabbitai

coderabbitai Bot commented May 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR implements LICENSE file distribution across Docker images for gateway and event-gateway components. A temporary target directory is created during build, LICENSE is copied into it and passed to Docker as a build context, then included in final runtime and controller images via COPY --from=target LICENSE /app/LICENSE directives. Build artifact directories are excluded from version control via .gitignore updates, and temporary staging directories are cleaned up after each build completes.

Suggested reviewers

  • malinthaprasan
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: including LICENSE files in gateway and event-gateway Docker images.
Linked Issues check ✅ Passed The PR directly addresses the linked issue #1968 by including LICENSE files in gateway and event-gateway Docker images to satisfy Apache License 2.0 distribution compliance requirements.
Out of Scope Changes check ✅ Passed All changes are scoped to the stated objective: modifying Dockerfiles and Makefiles to include LICENSE, updating .gitignore, and no unrelated code modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The pull request description comprehensively addresses all required template sections with specific context and verification details.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Stage the repo-root LICENSE into /app/LICENSE for the gateway-builder
image, matching the pattern already used by gateway-runtime,
gateway-controller, and event-gateway-runtime.

- Add target/ build-context with LICENSE for both build and
  build-and-push-multiarch targets.
- Place at /app/LICENSE (consistent with other images); /workspace is
  reserved for user policy projects mounted at runtime.
- Gitignore the new gateway-builder/target/ directory.
@renuka-fernando renuka-fernando merged commit 248ccfa into wso2:main May 14, 2026
5 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Task]: Include License file inside the Docker image

2 participants