Documentation
¶
Index ¶
- type Container
- func (c *Container) BuildImage() error
- func (c *Container) Execute(ctx context.Context, cmd []string) (string, error)
- func (c *Container) IsRunning(ctx context.Context) bool
- func (c *Container) Run(ctx context.Context, cmd []string, paths []string) error
- func (c *Container) StopAndRemove(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Container ¶
type Container struct {
ContainerID string
ImageName string
// contains filtered or unexported fields
}
Container is a wrapper around the Docker client that provides methods for building and running a specific container. It encapsulates the complexity of Docker operations.
func NewContainer ¶
NewContainer creates a new Container manager instance. It initializes a Docker client using the host's Docker environment settings.
func (*Container) BuildImage ¶
BuildImage constructs a Docker image from a Dockerfile in the specified directory.
func (*Container) Execute ¶
Execute executes a command in the running container and returns the output.
Click to show internal directories.
Click to hide internal directories.