Skip to content

Commit

Permalink
Remove upx as we don't need the size decrease
Browse files Browse the repository at this point in the history
  • Loading branch information
scme0 committed Mar 19, 2024
1 parent 49253f0 commit 901a0e6
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 19 deletions.
4 changes: 0 additions & 4 deletions .nuke/build.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,6 @@
"TestRuntime": {
"type": "string"
},
"UpxVersion": {
"type": "string",
"description": "The version of upx to use when building the bootstrapRunner executable for the Kubernetes Tentacle"
},
"Verbosity": {
"type": "string",
"description": "Logging verbosity during build execution. Default is 'Normal'",
Expand Down
4 changes: 1 addition & 3 deletions build/Build.Pack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ partial class Build
Name = "DockerPlatform")]
string DockerPlatform = "linux/arm64,linux/amd64";

[Parameter("The version of upx to use when building the bootstrapRunner executable for the Kubernetes Tentacle")] string UpxVersion = "4.2.2";

[PublicAPI]
Target PackOsxTarballs => _ => _
.Description("Packs the OS/X tarballs containing the published binaries.")
Expand Down Expand Up @@ -562,7 +560,7 @@ void BuildAndPushOrLoadKubernetesTentacleContainerImage(bool push, bool load, st
tag += "-debug";

settings = settings
.AddBuildArg($"BUILD_NUMBER={FullSemVer}", $"BUILD_DATE={DateTime.UtcNow:O}", $"UPX_VERSION={UpxVersion}")
.AddBuildArg($"BUILD_NUMBER={FullSemVer}", $"BUILD_DATE={DateTime.UtcNow:O}")
.SetPlatform(DockerPlatform)
.SetTag(tag)
.SetFile(dockerfile)
Expand Down
12 changes: 0 additions & 12 deletions docker/kubernetes-tentacle/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,12 @@ FROM golang:1.22 as bootstrapRunnerBuilder

ARG TARGETARCH
ARG TARGETOS
ARG UPX_VERSION="4.2.2"

COPY docker/kubernetes-tentacle/bootstrapRunner/* /bootstrapRunner/
WORKDIR /bootstrapRunner

# need to install xz-utils to unpack upx
RUN apt update
RUN apt install -y xz-utils

#download upx and unpack
RUN curl -OL "https://github.com/upx/upx/releases/download/v${UPX_VERSION}/upx-${UPX_VERSION}-${TARGETARCH}_${TARGETOS}.tar.xz"
RUN tar -x -f "upx-${UPX_VERSION}-${TARGETARCH}_${TARGETOS}.tar.xz"

# build bootstrapRunner
# Note: the given ldflags remove debug symbols
RUN go build -ldflags "-s -w" -o "bin/bootstrapRunner"
# upx reduces the size of the exe
RUN "./upx-${UPX_VERSION}-${TARGETARCH}_${TARGETOS}/upx" "bin/bootstrapRunner"

FROM mcr.microsoft.com/dotnet/runtime-deps:6.0

Expand Down

0 comments on commit 901a0e6

Please sign in to comment.