implement method for FlyDB-Cloud
sjcsjc123 opened this issue · comments
This FlyDB-Cloud needs to add some operations to simulate Docker or Podman commands. If you are interested in cloud native, this is a good issue! You can visit https://github.com/containers/buildah and https://github.com/sealerio/sealer/blob/main/pkg/imageengine/interface.go
// Image is the interface for image operations.
type Image interface {
// Login logs in to a container registry.
Login(opts *LoginOptions) error
// Logout logs out of a container registry.
Logout(opts *LogoutOptions) error
// Push pushes an image to a container registry.
Push(opts *PushOptions) error
// Pull pulls an image from a container registry.
Pull(opts *PullOptions) (string, error)
// Images lists images.
Images(opts *ImagesOptions) error
// Run runs an image.
Run(opts *RunOptions) error
// Rm removes containers.
Rm(opts *RmOptions) error
// Rmi removes images.
Rmi(opts *RmiOptions) error
// Tag tags an image.
Tag(opts *TagOptions) error
// Inspect inspects an image.
Inspect(opts *InspectOptions) (*Spec, error)
// Build builds an image.
Build(opts *BuildOptions) (string, error)
}
https://pkg.go.dev/github.com/docker/docker/client, the official document here has an api that can directly operate docker. Do we still need to redefine and implement the interface?
This is for docker
. We have another plan for podman
. Maybe we can encapsulate the two types of sdks into one method and add an External variable to determine whether it is a docker
or a podman
.