LinuxCommandLibrary

apx-stacks

Manage declarative stacks using APX package manager

TLDR

Interactively create a new stack configuration

$ apx stacks new
copy

Interactively update a stack configuration
$ apx stacks update [name]
copy

List all available stack configurations
$ apx stacks list
copy

Remove a specified stack configuration
$ apx stacks rm --name [string]
copy

Import a stack configuration
$ apx stacks import --input [path/to/stack.yml]
copy

Export the stack configuration (Note: The output flag is optional, it is exported to the current working directory by default)
$ apx stacks export --name [string] --output [path/to/output_file]
copy

SYNOPSIS

apx stacks {list|enter stack|run stack cmd|delete stack} [options]

PARAMETERS

list
    List all available stack names and descriptions

enter stack
    Start an interactive shell in the specified stack's container

run stack cmd [args]
    Execute a command and arguments in the stack's container

delete stack
    Remove the container and packages for the specified stack

-h, --help
    Display help for the stacks subcommand

DESCRIPTION

The apx stacks command is a subcommand of apx, a tool for running Alpine Linux in sandboxed containers using bubblewrap or Podman. Stacks are pre-configured environments bundling essential packages for development workflows, such as Rust, Node.js, Python, Go, C/C++, and more.

These stacks simplify setting up reproducible dev environments without polluting the host system. Users can list available stacks, enter an interactive shell in a stack's container, run one-off commands, or delete unused stacks. Stacks are defined in /usr/share/apx/stacks/ as APK package lists, pulled on first use.

Ideal for developers needing isolated toolchains, it integrates seamlessly with apx's container lifecycle, supporting persistent home directories and profile-based customizations. No root required in many cases.

CAVEATS

Stacks download packages on first use; requires network. Containers persist unless deleted. Global apx options like --profile apply. Limited to predefined stacks; custom stacks need manual config.

AVAILABLE STACKS

Common stacks: rust, node, python, go, cpp, base. Run apx stacks list for full list.
Example: apx stacks enter rust

CUSTOMIZATION

Stacks respect APX_HOME and profiles. Add packages via apx enter -- stack apk add extra-pkg.

HISTORY

Introduced in apx v0.12 (2024) by Alpine Linux contributors to streamline dev environments. Evolved from user demand for quick language/tool setups, building on apx's 2023 launch.

SEE ALSO

apx(1), apk(8), bubblewrap(1), podman(1)

Copied to clipboard