On Mon, Nov 22, 2021, at 8:30 PM, Brent Baude wrote:
When using the above bindings, I am getting below error:
<snip>
# pkg-config --cflags -- devmapper
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 variable
Package 'devmapper', required by 'virtual:world', not found
pkg-config: exit status 1
#include <btrfs/ioctl.h>
^~~~~~~~~~~~~~~
compilation terminated.
</snip>
Versions:
Go: go version go1.15.14 linux/amd64
OS: Red Hat Enterprise Linux release 8.4 (Ootpa) (CSB)
Go.mod:
module example.com
go 1.15
require (
)
Code:
<snip a2.go>
package main
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.
Hi Niranjan,
Thanks for reaching out.
Hi all
I 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?
The bindings live in pkg/bindings/{containers,images,...}.
Kind regards,
Valentin
Regards
Niranjan.
_______________________________________________
_______________________________________________