CLI Reference
Complete reference for all Swiftdock command-line interface commands.
swiftdock pull
Pull an OCI/Docker image from a registry.
Usage
swift run swiftdock pull <IMAGE>
Arguments
<IMAGE>- Image reference (e.g.,alpine:latest,nginx:1.21)
Examples
# Pull Alpine Linux
swift run swiftdock pull alpine:latest
# Pull specific version
swift run swiftdock pull ubuntu:22.04
# Pull from Docker Hub (default)
swift run swiftdock pull nginx:latest
swiftdock run
Create and start a container from an image.
Usage
swift run swiftdock run <IMAGE> -- <COMMAND> [ARGS...]
Arguments
<IMAGE>- Image reference--- Separator (required)<COMMAND>- Command to execute in the container[ARGS...]- Additional arguments to pass to the command
Examples
# Run echo command
swift run swiftdock run alpine:latest -- echo "Hello World"
# Run shell command with arguments
swift run swiftdock run alpine:latest -- sh -c "echo 'Multiple commands'"
# Run a simple command
swift run swiftdock run ubuntu:latest -- whoami
Output
Creating container for alpine:latest...
Created 6B53E52E-B2EC-435D-B957-B5202C1E5677
Starting...
Started with PID 85965
(Polling for exit...)
Container exited.
Hello World
swiftdock ps
List all containers (running and exited).
Usage
swift run swiftdock ps
Output Format
Displays containers in a table format:
CONTAINER ID IMAGE STATUS PID
6B53E52E-B2E alpine:latest exited 85965
2DF48833-0B9 alpine:latest created 0
Status Values
created- Container created but not startedrunning- Container is currently runningexited- Container has finished execution
swiftdock logs
Fetch stdout/stderr logs from a container.
Usage
swift run swiftdock logs <CONTAINER_ID>
Arguments
<CONTAINER_ID>- Full container ID (UUID)
Examples
# Get logs from a container
swift run swiftdock logs 6B53E52E-B2EC-435D-B957-B5202C1E5677
Note
You must use the full container ID, not the truncated version shown in ps. Get the full ID from the run command output.
Global Behavior
- All commands require the daemon (
swiftdockd) to be running - Commands communicate with the daemon via HTTP on
localhost:8080 - If the daemon is not running, you'll see:
Could not connect to swiftdockd daemon