forked from juanfont/headscale
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
trim dockerfiles, script to rebuild test images (juanfont#1403)
- Loading branch information
Showing
5 changed files
with
68 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,16 @@ | ||
FROM ubuntu:latest | ||
FROM ubuntu:22.04 | ||
|
||
ARG TAILSCALE_VERSION=* | ||
ARG TAILSCALE_CHANNEL=stable | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y gnupg curl ssh \ | ||
&& curl -fsSL https://pkgs.tailscale.com/${TAILSCALE_CHANNEL}/ubuntu/focal.gpg | apt-key add - \ | ||
&& apt-get install -y gnupg curl ssh dnsutils ca-certificates \ | ||
&& adduser --shell=/bin/bash ssh-it-user | ||
|
||
# Tailscale is deliberately split into a second stage so we can cash utils as a seperate layer. | ||
RUN curl -fsSL https://pkgs.tailscale.com/${TAILSCALE_CHANNEL}/ubuntu/focal.gpg | apt-key add - \ | ||
&& curl -fsSL https://pkgs.tailscale.com/${TAILSCALE_CHANNEL}/ubuntu/focal.list | tee /etc/apt/sources.list.d/tailscale.list \ | ||
&& apt-get update \ | ||
&& apt-get install -y ca-certificates tailscale=${TAILSCALE_VERSION} dnsutils \ | ||
&& apt-get install -y tailscale=${TAILSCALE_VERSION} \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN adduser --shell=/bin/bash ssh-it-user | ||
|
||
ADD integration_test/etc_embedded_derp/tls/server.crt /usr/local/share/ca-certificates/ | ||
RUN chmod 644 /usr/local/share/ca-certificates/server.crt | ||
|
||
RUN update-ca-certificates |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
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) | ||
} | ||
|
||
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) | ||
} | ||
|
||
err = tsClient.Shutdown() | ||
if err != nil { | ||
log.Fatalf("failed to shut down container: %s", err) | ||
} | ||
} | ||
|
||
network.Close() | ||
err = pool.RemoveNetwork(network) | ||
if err != nil { | ||
log.Fatalf("failed to remove network: %s", err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters