Skip to content

Commit

Permalink
add small cmd to rebuild all docker images
Browse files Browse the repository at this point in the history
Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
  • Loading branch information
kradalby committed May 1, 2023
1 parent 622e2be commit 94d2289
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions cmd/build-docker-img/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package main

import (
"log"

"github.com/juanfont/headscale/integration"
"github.com/juanfont/headscale/integration/tsic"
"github.com/ory/dockertest/v3"
)

func main() {
log.Printf("creating docker pool")
pool, err := dockertest.NewPool("")
if err != nil {
log.Fatalf("could not connect to docker: %s", err)
}

log.Printf("creating docker network")
network, err := pool.CreateNetwork("docker-integration-net")
if err != nil {
log.Fatalf("failed to create or get network: %s", err)
}
defer network.Close()
defer pool.RemoveContainerByName("docker-integration-net")

for _, version := range integration.TailscaleVersions {
log.Printf("creating container image for Tailscale (%s)", version)

tsClient, err := tsic.New(
pool,
version,
network,
)
if err != nil {
log.Fatalf("failed to create tailscale node: %s", err)
}

tsClient.Shutdown()
}
}

0 comments on commit 94d2289

Please sign in to comment.