github.com/angryronald/go-kit@v0.0.0-20240505173814-ff2bd9c79dbf/test/docker/kafka/kafka.sample.docker-compose.go (about)

     1  package kafka
     2  
     3  // uncomment to run this - [Works]
     4  
     5  // package main
     6  
     7  // import (
     8  // 	"fmt"
     9  // 	"os"
    10  // 	"os/exec"
    11  // 
    12  // )
    13  
    14  // func main() {
    15  // 	// Define the command you want to run
    16  // 	cmd := exec.Command("docker-compose", "up", "-d")
    17  
    18  // 	// Set the working directory to the location of your docker-compose.yml file
    19  // 	cmd.Dir = "."
    20  
    21  // 	// Capture and print the command's output
    22  // 	output, err := cmd.CombinedOutput()
    23  // 	if err != nil {
    24  // 		fmt.Println("Error:", err)
    25  // 		os.Exit(1)
    26  // 	}
    27  
    28  // 	fmt.Println("Command Output:", string(output))
    29  
    30  // 	cmd = exec.Command("docker", "ps", "-a")
    31  
    32  // 	// Capture and print the command's output
    33  // 	output, err = cmd.CombinedOutput()
    34  // 	if err != nil {
    35  // 		fmt.Println("Error:", err)
    36  // 		os.Exit(1)
    37  // 	}
    38  
    39  // 	fmt.Println("Command Output:", string(output))
    40  
    41  // }