From 01aa7b939b2485fa8d8ff5d1f25623af394ac268 Mon Sep 17 00:00:00 2001 From: Alastair Pitts Date: Tue, 2 Jun 2026 16:50:17 +1000 Subject: [PATCH 1/2] chmod the binary to executable before building docker image --- build/Build.Docker.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build/Build.Docker.cs b/build/Build.Docker.cs index 4c88bc9f4..a9a379a1b 100644 --- a/build/Build.Docker.cs +++ b/build/Build.Docker.cs @@ -28,6 +28,12 @@ public partial class Build compressedArtifactPath.UncompressTo(flavourFolder); Log.Information("Uncompressed {ZipPath} to {FolderPath}", compressedArtifactPath, flavourFolder); + // change the native binary to be executable + PowerShellTasks.PowerShell(_ => _ + .EnableNoProfile() + .SetCommand($"chmod +x '{flavourFolder / flavour}'")); + + //Rename any `linux-x64` folders to `linux-amd64` Directory.Move(flavourFolder / "linux-x64", flavourFolder / "linux-amd64"); From db2183922d9948f0ef09c12c25e6ecd162861363 Mon Sep 17 00:00:00 2001 From: Alastair Pitts Date: Tue, 2 Jun 2026 17:13:49 +1000 Subject: [PATCH 2/2] Per platform binaries --- build/Build.Docker.cs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/build/Build.Docker.cs b/build/Build.Docker.cs index a9a379a1b..63878e75d 100644 --- a/build/Build.Docker.cs +++ b/build/Build.Docker.cs @@ -23,21 +23,23 @@ public partial class Build Logging.InBlock(flavour, () => { var flavourFolder = KnownPaths.OutputsDirectory / flavour; - + var compressedArtifactPath = KnownPaths.OutputsDirectory / $"{flavour}.zip"; compressedArtifactPath.UncompressTo(flavourFolder); Log.Information("Uncompressed {ZipPath} to {FolderPath}", compressedArtifactPath, flavourFolder); - // change the native binary to be executable - PowerShellTasks.PowerShell(_ => _ - .EnableNoProfile() - .SetCommand($"chmod +x '{flavourFolder / flavour}'")); - - //Rename any `linux-x64` folders to `linux-amd64` Directory.Move(flavourFolder / "linux-x64", flavourFolder / "linux-amd64"); Log.Information("Renamed 'linux-x64' folder to 'linux-amd64'"); + foreach (var supportedPlatform in supportedPlatforms) + { + var platformFolder = supportedPlatform.Replace("/", "-"); + // change the native binary to be executable in each platform + PowerShellTasks.PowerShell(_ => _ + .EnableNoProfile() + .SetCommand($"chmod +x '{flavourFolder / platformFolder / flavour}'")); + } var tag = $"octopusdeploy/{flavour}:{NugetVersion.Value}".ToLowerInvariant();