License for the Apple/Container Project: Apache 2.0 Terms and Compliance

The Apple Container repository is released under the Apache License Version 2.0, a permissive open-source license stored in the repository's LICENSE file that grants worldwide, royalty-free rights to use, modify, and distribute the code.

The apple/container project provides a container implementation for Swift, and understanding its licensing terms is essential for developers integrating this code into commercial or open-source applications. The project follows standard open-source practices by including the full Apache 2.0 text in the LICENSE file and maintaining proper attribution notices in NOTICE.md at the repository root.

Understanding the Apache 2.0 License

The apple/container project adopts Apache License Version 2.0, one of the most widely used permissive licenses in modern open-source development. This license grants users worldwide, royalty-free rights to use, modify, and distribute the code without restriction on usage domains, including commercial applications.

A distinctive feature of Apache 2.0 is its explicit patent-grant clause, which protects downstream users from patent claims by contributors. According to the license terms in the LICENSE file, if Apple or any contributor holds patents covering the code, they cannot later sue users for patent infringement when using the project according to the license terms.

The repository contains several files that define the legal framework for using the code:

LICENSE

The LICENSE file at the repository root contains the complete Apache 2.0 license text. This document serves as the legal contract between Apple and users of the project, detailing the exact terms under which the software can be used, modified, and shared. You can view the official copy directly at https://github.com/apple/container/blob/main/LICENSE.

NOTICE.md

The NOTICE.md file contains attribution notices required for redistribution. As implemented in apple/container, this file preserves copyright attributions and must be included in any derivative work that redistributes the code. The Apache 2.0 license explicitly requires preserving these notices to ensure proper credit to Apple Inc. and contributors.

README.md and Package.swift

While README.md mentions the project overview and licensing context, the Package.swift file serves as the Swift Package Manager manifest reflecting the project's open-source distribution model. Together, these files confirm that the apple/container code is intended for public use under the terms specified in LICENSE.

Compliance Requirements for Users

When using or redistributing the apple/container code, you must comply with specific requirements to maintain the license terms:

  • Preserve Copyright Notices: All copyright notices found in source files must remain intact in any distribution.
  • Include License Text: A copy of the Apache 2.0 license must accompany redistributed code, typically by including the LICENSE file.
  • Retain Attribution: The contents of NOTICE.md must be preserved in derivative works, ensuring continued attribution to Apple Inc. and other contributors listed in the file.

These requirements ensure that the open-source nature of the project is maintained while allowing maximum flexibility for both commercial and non-commercial use.

Practical Implementation: Adding License Headers

When creating new files in a fork or derivative project based on apple/container, include the standard Apache 2.0 header to maintain compliance. Here is the recommended format for Swift source files:

// ---------------------------------------------------------------------
// Copyright © <year> Apple Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//    http://www.apache.org/licenses/LICENSE-2.0
// ---------------------------------------------------------------------

import Foundation

// Your implementation follows…

For build-time verification, implement a script to validate the presence of the license file:

#!/usr/bin/env swift

import Foundation

let licensePath = "./LICENSE"
guard let license = try? String(contentsOfFile: licensePath) else {
    fatalError("License file missing!")
}
print("Project is licensed under: \(license.prefix(30))…")

When configuring your package manifest, note the Apache 2.0 status to document the licensing terms:

let package = Package(
    name: "Container",
    products: [/* … */],
    dependencies: [/* … */],
    targets: [/* … */],
    swiftLanguageVersions: [.v5]
)

// The package is released under Apache‑2.0 (see LICENSE)

Summary

  • The apple/container project uses the Apache License Version 2.0, a permissive open-source license.
  • The full legal text resides in the LICENSE file, with attribution requirements specified in NOTICE.md.
  • Apache 2.0 grants worldwide, royalty-free usage rights including commercial use, with explicit patent protection for users.
  • Redistribution requires preserving copyright notices, the license text, and the NOTICE.md attributions.
  • New Swift files should include the standard Apache 2.0 header referencing Apple Inc. copyright to maintain compliance.

Frequently Asked Questions

Is the Apple Container project open source?

Yes, the apple/container project is fully open source. It is released under the Apache License Version 2.0, which allows anyone to view, use, modify, and distribute the source code. The repository is publicly available on GitHub under the apple/container organization with the full license text included in the LICENSE file.

What are the main restrictions of the Apache 2.0 license?

The Apache 2.0 license imposes minimal restrictions: you must preserve copyright notices and the license text in any distribution, and you must include the NOTICE.md file contents if provided. The license prohibits using the project's trademarks without permission, but otherwise grants broad rights to use the code commercially or privately without requiring derivative works to use the same license.

Do I need to include the NOTICE.md file in my derivative work?

Yes, if you redistribute the apple/container code or create a derivative work, you must retain the contents of the NOTICE.md file. This file contains attribution notices required by the Apache 2.0 license, ensuring that Apple Inc. and contributors receive proper credit in your distribution. Failure to include this file violates the license terms.

Where can I find the full license text for Apple Container?

The complete license text is located in the LICENSE file at the root of the apple/container repository on GitHub. You can view the official copy at https://github.com/apple/container/blob/main/LICENSE. The README.md file also references the licensing terms for quick confirmation of the project's open-source status.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →