diff --git a/.nuke/build.schema.json b/.nuke/build.schema.json index 2ae5a55cd..4d2042de3 100644 --- a/.nuke/build.schema.json +++ b/.nuke/build.schema.json @@ -123,6 +123,7 @@ "PackChocolateyPackage", "PackClient", "PackContracts", + "PackCore", "PackCrossPlatformBundle", "PackDebianPackage", "PackLinux", @@ -172,6 +173,7 @@ "PackChocolateyPackage", "PackClient", "PackContracts", + "PackCore", "PackCrossPlatformBundle", "PackDebianPackage", "PackLinux", diff --git a/docker/kubernetes-agent-tentacle/Dockerfile b/docker/kubernetes-agent-tentacle/Dockerfile index 9c951ad3a..4e498ac7d 100644 --- a/docker/kubernetes-agent-tentacle/Dockerfile +++ b/docker/kubernetes-agent-tentacle/Dockerfile @@ -1,7 +1,6 @@ ARG RuntimeDepsTag - -FROM golang:1.22 as bootstrapRunnerBuilder +FROM golang:1.24 AS bootstrapRunnerBuilder ARG TARGETARCH ARG TARGETOS @@ -10,8 +9,8 @@ COPY docker/kubernetes-agent-tentacle/bootstrapRunner/* /bootstrapRunner/ WORKDIR /bootstrapRunner # Note: the given ldflags remove debug symbols -RUN go build -ldflags "-s -w" -o "bin/bootstrapRunner" - +RUN env GOOS=linux GOARCH=amd64 go build -ldflags "-s -w" -o "bin/bootstrapRunner-amd64" +RUN env GOOS=linux GOARCH=arm64 go build -ldflags "-s -w" -o "bin/bootstrapRunner-arm64" FROM mcr.microsoft.com/dotnet/runtime-deps:$RuntimeDepsTag @@ -24,7 +23,8 @@ ARG TARGETVARIANT EXPOSE 10933 COPY docker/kubernetes-agent-tentacle/scripts/* /scripts/ -COPY --from=bootstrapRunnerBuilder bootstrapRunner/bin/bootstrapRunner /bootstrapRunner +COPY --from=bootstrapRunnerBuilder bootstrapRunner/bin/bootstrapRunner-amd64 /bootstrapRunner-amd64 +COPY --from=bootstrapRunnerBuilder bootstrapRunner/bin/bootstrapRunner-arm64 /bootstrapRunner-arm64 RUN chmod +x /scripts/*.sh WORKDIR /tmp diff --git a/docker/kubernetes-agent-tentacle/dev/Dockerfile b/docker/kubernetes-agent-tentacle/dev/Dockerfile index 73fac5398..4486a3ded 100644 --- a/docker/kubernetes-agent-tentacle/dev/Dockerfile +++ b/docker/kubernetes-agent-tentacle/dev/Dockerfile @@ -1,7 +1,6 @@ ARG RuntimeDepsTag - -FROM golang:1.22 as bootstrapRunnerBuilder +FROM golang:1.24 AS bootstrapRunnerBuilder ARG TARGETARCH ARG TARGETOS @@ -10,8 +9,8 @@ COPY docker/kubernetes-agent-tentacle/bootstrapRunner/* /bootstrapRunner/ WORKDIR /bootstrapRunner # Note: the given ldflags remove debug symbols -RUN go build -ldflags "-s -w" -o "bin/bootstrapRunner" - +RUN env GOOS=linux GOARCH=amd64 go build -ldflags "-s -w" -o "bin/bootstrapRunner/amd64" +RUN env GOOS=linux GOARCH=arm64 go build -ldflags "-s -w" -o "bin/bootstrapRunner/arm64" FROM mcr.microsoft.com/dotnet/runtime-deps:$RuntimeDepsTag diff --git a/source/Octopus.Tentacle/Kubernetes/KubernetesScriptPodCreator.cs b/source/Octopus.Tentacle/Kubernetes/KubernetesScriptPodCreator.cs index 52143e58c..2bb26df40 100644 --- a/source/Octopus.Tentacle/Kubernetes/KubernetesScriptPodCreator.cs +++ b/source/Octopus.Tentacle/Kubernetes/KubernetesScriptPodCreator.cs @@ -176,7 +176,8 @@ async Task CreatePod(StartKubernetesScriptCommandV1 command, IScriptWorkspace wo LogVerboseToBothLogs($"Creating Kubernetes Pod '{podName}'.", tentacleScriptLog); - workspace.CopyFile(KubernetesConfig.BootstrapRunnerExecutablePath, "bootstrapRunner", true); + workspace.CopyFile($"{KubernetesConfig.BootstrapRunnerExecutablePath}-amd64", "bootstrapRunner-amd64", true); + workspace.CopyFile($"{KubernetesConfig.BootstrapRunnerExecutablePath}-arm64", "bootstrapRunner-arm64", true); var scriptName = Path.GetFileName(workspace.BootstrapScriptFilePath); var workspacePath = Path.Combine("Work", workspace.ScriptTicket.TaskId); @@ -292,7 +293,7 @@ protected async Task CreateScriptContainer(StartKubernetesScriptCom var commandString = string.Join(" ", new[] { - $"{homeDir}/Work/{command.ScriptTicket.TaskId}/bootstrapRunner", + $"{homeDir}/Work/{command.ScriptTicket.TaskId}/bootstrapRunner-$(arch | sed -n '/arm/ {{s/.*arm.*/arm/;p;q}}; $a\\amd64')", Path.Combine(homeDir, workspacePath), Path.Combine(homeDir, workspacePath, scriptName) }.Concat(scriptArguments ?? Array.Empty())