feat: Add heropods library to plbook

- Import heropods library
- Play heropods library in plbook
This commit is contained in:
Mahmoud-Emad
2025-11-11 10:40:27 +02:00
parent 3ae980d4c5
commit 2fafd025eb
2 changed files with 59 additions and 1 deletions

View File

@@ -0,0 +1,57 @@
#!/usr/bin/env hero
// HeroPods Heroscript Demo
// This demonstrates using heropods functionality through pure heroscript
// Execute with: hero examples/virt/heropods/demo.heroscript
// Configure the heropods instance
!!heropods.configure
name:'demo'
reset:false
use_podman:true
// Create a new Alpine container using podman to pull the image
!!heropods.container_new
name:'demo_container'
image:'custom'
custom_image_name:'alpine_3_20'
docker_url:'docker.io/library/alpine:3.20'
// Start the container
!!heropods.container_start
name:'demo_container'
// Execute some commands in the container
!!heropods.container_exec
name:'demo_container'
cmd:'uname -a'
stdout:true
!!heropods.container_exec
name:'demo_container'
cmd:'cat /etc/os-release'
stdout:true
!!heropods.container_exec
name:'demo_container'
cmd:'ls /bin'
stdout:true
!!heropods.container_exec
name:'demo_container'
cmd:'pwd'
stdout:true
!!heropods.container_exec
name:'demo_container'
cmd:'whoami'
stdout:true
// Stop the container
!!heropods.container_stop
name:'demo_container'
// Delete the container
!!heropods.container_delete
name:'demo_container'