FlyDB icon indicating copy to clipboard operation
FlyDB copied to clipboard

implement method for FlyDB-Cloud

Open sjcsjc123 opened this issue 2 years ago • 2 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)
}

sjcsjc123 avatar Jul 09 '23 14:07 sjcsjc123

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?

chdlvy avatar Aug 06 '23 06:08 chdlvy

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.

sjcsjc123 avatar Aug 07 '23 01:08 sjcsjc123