README ¶ go-containers: Go Docker Containers package This Go package provides a simple interface for running Docker containers directly from a host system. Features Pull Docker Image: The RunContainerOnHost function pulls a Docker image from a Docker registry. Create Docker Container: The function creates a Docker container from the pulled image. Run Docker Container: It then runs the Docker container on the host. Wait For Container To Complete: The function waits for the Docker container to finish its execution. Fetch Logs: It fetches and prints the logs of the Docker container to os.Stdout. Dependencies This package uses the following dependencies: context: Standard Go package for carrying deadlines, cancellations signals, and other request-scoped values across API boundaries. github.com/docker/docker/api/types: Docker API types. github.com/docker/docker/api/types/container: Docker container types. github.com/docker/docker/client: Docker client to interact with Docker API. io: Standard Go package for basic interfaces to I/O primitives. os: Standard Go package that provides a platform-independent interface to operating system functionality. Usage package main import ( "github.com/zcubbs/gocontainers" ) func main() { image := "ubuntu:latest" cmd := []string{"/bin/sh", "-c", "echo Hello, World"} err := gocontainers.RunContainerOnHost(image, cmd) if err != nil { panic(err) } } License This project is licensed under the MIT License - see the LICENSE file for details. Expand ▾ Collapse ▴ Documentation ¶ Index ¶ func RunContainerOnHost(image string, cmd []string) (err error) Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func RunContainerOnHost ¶ func RunContainerOnHost(image string, cmd []string) (err error) Types ¶ This section is empty. Source Files ¶ View all Source files run_container.go Click to show internal directories. Click to hide internal directories.