Skip to content
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

Built binaries are not stripped #6649

Open
croustiPoulet opened this issue Sep 1, 2022 · 2 comments · May be fixed by #8927
Open

Built binaries are not stripped #6649

croustiPoulet opened this issue Sep 1, 2022 · 2 comments · May be fixed by #8927
Labels
good first issue Good for first-time contributors looking to learn about Calico help wanted kind/enhancement

Comments

@croustiPoulet
Copy link

Built binaries are not stripped

Expected Behavior

Built binaries are as small as possible to reduce docker images size.

Current Behavior

As an example, calico-node is not stripped:
calico-node: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, Go BuildID=Zj-dNERc1XZs22xTIG4a/6iGR1YjI3SePsudHbMMA/BM-owAa7TDzFpy2od1aW/84jlD79A8qOMoOkeJqpA, BuildID[sha1]=519824671dc019b4983ac44e98740d4c76d2c9fa, not stripped

This is the same for binaries in kube-controllers, cni and node docker images.

Possible Solution

Use ldflags "-w -s"

@caseydavenport caseydavenport added kind/enhancement help wanted good first issue Good for first-time contributors looking to learn about Calico labels Sep 1, 2022
@caseydavenport
Copy link
Member

The one complexity here is that we use the symbols as part of our dev process to verify the correct TLS boringcrypto symbols show up.

What we should do is keep the symbols for pre-release / development images, and then strip them when we cut a release.

@afshin-deriv
Copy link
Contributor

@caseydavenport Please help to review this solution for adding ldflags "-w -s" exactly during the final release.

@hjiawei hjiawei linked a pull request Jun 18, 2024 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for first-time contributors looking to learn about Calico help wanted kind/enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants