alpine exec

Description

Executes a non-interactive command inside a running instance over SSH.

Usage

alpine exec <instance> <command>

Aliases

x, execute, cmd, command

Example

To check the kernel version of an instance named my-vm:

alpine exec my-vm "uname -r"
# 5.15.60-0-virt

To update packages inside the VM:

alpine exec my-vm "apk update && apk upgrade"