Codebase

Navigate the Codebase using the tree view. Use the filters to highlight where various files are grouped to aid understanding.

Getting Started Commands

Project Structure

Below is a short description of the key directories of the project to aid you when understanding where key files are located.

CODE_OF_CONDUCT.md, CONTRIBUTING.md, LICENSE, Makefile, NEWS.md, README.md, apk.md, go.mod, go.sum, header.tmpl, main.go, release.md - These are various files used for managing the project, such as the code of conduct, contributing guidelines, license information, build instructions, and the main source code file.
config/ - This directory contains configuration files for the project. The main configuration file is task.yaml, which is used to define tasks and their dependencies.
docs/ - This directory contains documentation for the project. The files include apko_file.md which provides an introduction to the project, build-process.md explaining the build process, and various other files covering topics such as busybox, faq, sbom-composition, and more.
examples/ - This directory contains examples of how to use the apko tool. Each file in this directory is a YAML configuration file that defines an Apko build.
hack/ - This directory contains scripts and tools used for development and testing. It includes scripts for building, publishing, and updating packages, as well as scripts for running tests and generating golden files.
internal/ - This directory contains the source code for the apko tool itself. It includes the cli/ directory which contains the command-line interface, gen-jsonschema/ for generating JSON schemas, tools.go for various utility functions, and other directories and files for different components of the apko tool.
mac/ - This directory contains files specific to building and running apko on macOS. It includes a subdirectory lima/ which contains an example configuration file for using apko with Lima, a macOS container runner.
pkg/ - This directory contains the packaged binaries and libraries for the apko tool. It includes subdirectories for build/ which contains the build system, lock/ for managing dependencies, log/ for logging, options/ for command-line options, passwd/ for managing user and group information, s6/ for supervision, sbom/ for software bill of materials, tarfs/ for working with tar files, vcs/ for version control, and vfs/ for virtual file systems.

Entrypoints

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

/internal/gen-jsonschema/main.go - This file contains the `main` function for generating JSON schemas for APKO configuration files. It reads the configuration files and generates the corresponding JSON schemas.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

/main.go - This file contains the `main` function that initializes and runs the APKO builder. It also defines the `mainE` function for handling errors during the build process.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

/pkg/build/busybox_gen_versions.go - This file is responsible for generating the versions of busybox applets used by APKO. It defines several functions including `main`, which runs the script, `getBusyboxApplets`, which retrieves a list of applets from the busybox source, `getBusyboxVersions`, which retrieves the versions of each applet, `getBusyboxAppletsForVersion`, which filters applets based on a given version, `semverLess`, which compares semantic versions, `appletLineToFullPath`, which converts an applet line to a full path, and `highestVersion`, which returns the highest version of a list of versions.