Skip to content

remove upx #4709

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 5, 2025
Merged

remove upx #4709

merged 2 commits into from
May 5, 2025

Conversation

jLopezbarb
Copy link
Contributor

Remove upx so we can have CVEs reports

Signed-off-by: Javier Lopez <javier@okteto.com>
@jLopezbarb jLopezbarb requested a review from a team as a code owner May 5, 2025 09:42
Copy link

codecov bot commented May 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 48.87%. Comparing base (8813c87) to head (e0451ab).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4709      +/-   ##
==========================================
+ Coverage   48.85%   48.87%   +0.02%     
==========================================
  Files         354      354              
  Lines       29522    29522              
==========================================
+ Hits        14424    14430       +6     
+ Misses      13952    13948       -4     
+ Partials     1146     1144       -2     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@ifbyol ifbyol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comments to update comments to prevent misunderstandings, as we are not compressing the binaries anymore, but changes look good

Dockerfile Outdated
&& tar -xf /usr/bin/upx.tar.xz -C /tmp \
&& cp /tmp/upx-4.2.1-amd64_linux/upx /usr/bin/upx \
&& chmod +x /usr/bin/upx

# Stage 2: Compress Okteto utility binaries to reduce final image size
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Stage 2: Compress Okteto utility binaries to reduce final image size
# Stage 2: Prepare binaries to be copied in final stages

Dockerfile Outdated

# Stage 3: Set up Go build environment for Kubernetes tools and Okteto CLI
FROM golang:${GOLANG_VERSION}-bookworm AS golang-builder
COPY --from=upx-provider /usr/bin/upx /usr/bin/upx

# Stage 3.1: Download and compress kustomize (Kubernetes resource customization tool)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Stage 3.1: Download and compress kustomize (Kubernetes resource customization tool)
# Stage 3.1: Download kustomize (Kubernetes resource customization tool)

Dockerfile Outdated
@@ -66,12 +45,7 @@ RUN curl -sLf --retry 3 -o kustomize.tar.gz \
&& chmod +x /usr/local/bin/kustomize \
&& rm kustomize.tar.gz \
# Verify binary works before compression
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Verify binary works before compression
# Verify binary works

Dockerfile Outdated
&& /usr/bin/upx --best --lzma /tmp/kustomize \
# Verify compressed binary still works
&& /tmp/kustomize version
&& /usr/local/bin/kustomize version

# Stage 3.2: Download and compress kubectl (Kubernetes CLI)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Stage 3.2: Download and compress kubectl (Kubernetes CLI)
# Stage 3.2: Download kubectl (Kubernetes CLI)

Dockerfile Outdated
@@ -82,12 +56,7 @@ RUN curl -sLf --retry 3 -o kubectl \
&& chmod +x kubectl \
&& mv kubectl /usr/local/bin/ \
# Verify binary works before compression
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Verify binary works before compression
# Verify binary works

Dockerfile Outdated
&& /usr/bin/upx --best --lzma /tmp/kubectl \
# Verify compressed binary still works
&& /usr/local/bin/kubectl version --client=true
&& /usr/local/bin/kubectl version --client=true

# Stage 3.3: Download and compress Helm (Kubernetes package manager)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Stage 3.3: Download and compress Helm (Kubernetes package manager)
# Stage 3.3: Download Helm (Kubernetes package manager)

Dockerfile Outdated
@@ -101,12 +70,7 @@ RUN curl -sLf --retry 3 -o helm.tar.gz \
&& chmod +x /usr/local/bin/helm \
&& rm -rf helm helm.tar.gz \
# Verify binary works before compression
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Verify binary works before compression
# Verify binary works

Dockerfile Outdated
&& /usr/bin/upx --best --lzma /tmp/helm \
# Verify compressed binary still works
&& /tmp/helm version
&& /usr/local/bin/helm version

# Stage 3.4: Download and compress git (Version control system)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Stage 3.4: Download and compress git (Version control system)
# Stage 3.4: Download git (Version control system)

Dockerfile Outdated
@@ -176,19 +135,19 @@ FROM busybox:${BUSYBOX_VERSION}
COPY --link --chmod=755 --from=certs /etc/ssl/certs /etc/ssl/certs

# Step 2: Copy compressed Kubernetes tools
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Step 2: Copy compressed Kubernetes tools
# Step 2: Copy Kubernetes tools

Signed-off-by: Javier Lopez <javier@okteto.com>
@jLopezbarb jLopezbarb added release/internal backport release-3.7 Backport this PR to CLI versions 3.7 labels May 5, 2025
@jLopezbarb jLopezbarb merged commit a0213b8 into master May 5, 2025
22 of 23 checks passed
@jLopezbarb jLopezbarb deleted the jlo/remove-upx branch May 5, 2025 10:31
github-actions bot pushed a commit that referenced this pull request May 5, 2025
* remove upx

Signed-off-by: Javier Lopez <javier@okteto.com>

* refactor: update comments for clarity in Dockerfile stages

Signed-off-by: Javier Lopez <javier@okteto.com>

---------

Signed-off-by: Javier Lopez <javier@okteto.com>
(cherry picked from commit a0213b8)
jLopezbarb added a commit that referenced this pull request May 5, 2025
* remove upx

Signed-off-by: Javier Lopez <javier@okteto.com>

* refactor: update comments for clarity in Dockerfile stages

Signed-off-by: Javier Lopez <javier@okteto.com>

---------

Signed-off-by: Javier Lopez <javier@okteto.com>
(cherry picked from commit a0213b8)

Co-authored-by: Javier López Barba <javier@okteto.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport release-3.7 Backport this PR to CLI versions 3.7 release/internal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants