import ( "fmt" "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/mount" "github.com/docker/docker/api/types/network" "github.com/docker/docker/api/types" "github.com/docker/docker/client" ) func main() { cli, err := client.NewEnvClient() if err != nil { panic(err) } resp, err := cli.ContainerCreate(ctx, &container.Config{ Image: "alpine", }, &container.HostConfig{ Binds: []string{ "/tmp:/tmp", }, Mounts: []mount.Mount{ { Type: mount.TypeBind, Source: "/data", Target: "/target", }, }, NetworkMode: container.NetworkMode("host"), }, &network.NetworkingConfig{}, "") if err != nil { panic(err) } if err := cli.ContainerStart(ctx, resp.ID, types.ContainerStartOptions{}); err != nil { panic(err) } out, err := cli.ContainerLogs(ctx, resp.ID, types.ContainerLogsOptions{ShowStdout: true}) if err != nil { panic(err) } defer out.Close() io.Copy(os.Stdout, out) }In this example, a container is created with host configuration that specifies a bind mount and a mount of type bind. Additionally, the container is configured to use the host network. The Docker Go SDK is used to create the container, start it, and retrieve its logs.