package main
import (
"context"
"fmt"
pbr "github.com/seoyhaein/podbridge"
)
func main() {
ctx, err := pbr.NewConnectionLinux(context.Background())
if err != nil {
panic(err)
}
// spec 만들기
conSpec := pbr.NewSpec()
conSpec.SetImage("docker.io/library/test07")
f := func(spec pbr.SpecGen) pbr.SpecGen {
spec.Name = "container-tester01"
spec.Terminal = true
return spec
}
conSpec.SetOther(f)
// 해당 이미지에 해당 shell script 가 있다.
conSpec.SetHealthChecker("CMD-SHELL /app/healthcheck/healthcheck.sh", "2s", 1, "30s", "1s")
// container 만들기
r := pbr.CreateContainer(ctx, conSpec)
fmt.Println("container Id is :", r.ID)
result := r.RunT(ctx, "1s")
v := int(result)
fmt.Println(v)
}
-
Notifications
You must be signed in to change notification settings - Fork 0
License
seoyhaein/podbridge
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published