On Mon, Nov 22, 2021, at 8:30 PM, Brent Baude wrote:When using the above bindings, I am getting below error:# pkg-config --cflags -- devmapper
<snip>Package devmapper was not found in the pkg-config search path.Perhaps you should add the directory containing `devmapper.pc'to the PKG_CONFIG_PATH environment variablePackage 'devmapper', required by 'virtual:world', not foundpkg-config: exit status 1../../../go/pkg/mod/github.com/containers/storage@v1.36.0/drivers/btrfs/btrfs.go:8:10: fatal error: btrfs/ioctl.h: No such file or directory#include <btrfs/ioctl.h>^~~~~~~~~~~~~~~compilation terminated.</snip>
Versions:Go: go version go1.15.14 linux/amd64OS: Red Hat Enterprise Linux release 8.4 (Ootpa) (CSB)go 1.15require (github.com/containers/podman/v2 v2.2.1 // indirect)Code:package main
<snip a2.go>import ("context""fmt""os")const (socketPath = "unix://run/user/11567/podman/podman.sock")func main() {conn, err := bindings.NewConnection(context.Background(), socketPath)if err != nil {fmt.Println(err)os.Exit(1)}fmt.Printf("conn is of type: %T\n", conn)_, err = images.Pull(conn, imageName, nil)if err != nil {fmt.Println(err)os.Exit(1)}}</snip>
When i execute the above code , i get the error described above.On Mon, Nov 22, 2021 at 3:12 AM Valentin Rothberg <rothberg@redhat.com> wrote:Hi Niranjan,Thanks for reaching out.On Mon, Nov 22, 2021 at 8:11 AM <niranjan@ashoo.in> wrote:Hi allI am looking for some code examples in Golang to use Podman REST API. Is there a repository or some code examples that i can refer to?Also while looking at the Podman REST API. (https://docs.podman.io/en/latest/_static/api.html). how do i call the "podman run" using the REST API ?A container run boils down to create+start. Some examples can be found in how the remote client of Podman is using the Go-bindings for the REST API, for example: https://github.com/containers/podman/blob/main/pkg/domain/infra/tunnel/containers.go#L711The bindings live in pkg/bindings/{containers,images,...}.Kind regards,ValentinRegardsNiranjan._______________________________________________Podman mailing list -- podman@lists.podman.ioTo unsubscribe send an email to podman-leave@lists.podman.io_______________________________________________Podman mailing list -- podman@lists.podman.ioTo unsubscribe send an email to podman-leave@lists.podman.io