Exemplo n.º 1
0
func createBus() {
	name := busName()
	image := "spotify/kafka"
	ports := []string{"2181/tcp", "9092/tcp"}
	env := []string{"ADVERTISED_HOST=bus", "ADVERTISED_PORT=9092"}

	ensureNoError(
		containers.Create(dockerClient, image, name, "bus", ports, env, []string{}),
		"Unable to create bus cluster",
	)
}
Exemplo n.º 2
0
func startApp() {
	name := serviceName() + "_1"
	image := serviceName()
	ports := []string{"8080/tcp"}

	ensureNoError(
		containers.Create(dockerClient, image, name, image, ports, []string{}, []string{"nanoservice_bus_1:bus"}),
		"Unable to create container from "+image+" with name "+name,
	)

	ensureNoError(
		containers.Start(dockerClient, name, ports),
		"Unable to start container "+name,
	)
}