Example: Marketplace/ Applications
9 min
End-to-end walkthrough: pull a Docker image from the Litmus Marketplace, run it as a container, inspect logs, and clean up.
Setup
from litmussdk import marketplace1. Browse the Marketplace
overview = marketplace.marketplace_overview()
images = marketplace.list_all_images()
# Find an image by name
target = next(i for i in images if "node-red" in i.get("Name", "").lower())
image_id = target["ID"]2. Pull an Image
marketplace.pull_image(image_id)
# Track the pull job
jobs = marketplace.list_image_pulls()
print(f"Active pulls: {len(jobs)}")3. Run a Container
running = marketplace.run_container({
"imageId": image_id,
"name": "my-node-red",
"ports": [{"hostPort": 1880, "containerPort": 1880}],
# ... other docker options
})
container_id = running["ID"]4. Inspect
all_containers = marketplace.list_all_containers()
me = next(c for c in all_containers if c["ID"] == container_id)
print(f"State: {me['State']}")
# Detail
detail = marketplace.container_inspect(container_id)
# Live logs
logs = marketplace.container_log(container_id, lines=200)
# Top processes
top = marketplace.container_top(container_id)5. Lifecycle
# Pause / unpause
marketplace.pause_containers([container_id])
marketplace.unpause_containers([container_id])
# Stop / start
marketplace.stop_containers([container_id])
marketplace.start_containers([container_id])6. Cleanup
# Remove container
marketplace.remove_containers_list_by_ids([container_id])
# Remove image
marketplace.remove_images([image_id])
# Reclaim space
marketplace.prune_containers()Image Upload (Custom Registries)
If you have a custom Docker image not in the public marketplace:
# From local file
marketplace.upload_image(file_path="/path/to/image.tar")
# From an FTP-accessible source
marketplace.upload_from_ftp(image_file_path="ftp://...")See Also
- Marketplace: Catalogs and Applications - if you're managing the marketplace itself across multiple Edges via Edge Manager