tools: strip binaries to save disk space#3769
Draft
Williangalvani wants to merge 1 commit intobluerobotics:masterfrom
Draft
tools: strip binaries to save disk space#3769Williangalvani wants to merge 1 commit intobluerobotics:masterfrom
Williangalvani wants to merge 1 commit intobluerobotics:masterfrom
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR reduces disk usage by installing binutils in the image build stage and stripping downloaded Rust (and other) binaries as part of each tool’s bootstrap script. Sequence diagram for updated tool bootstrap installation and strippingsequenceDiagram
actor User
participant BootstrapScript
participant RemoteServer
participant FileSystem
participant BinutilsStrip
User->>BootstrapScript: Execute bootstrap.sh
BootstrapScript->>BootstrapScript: Set BINARY_PATH and REMOTE_URL
BootstrapScript->>RemoteServer: wget REMOTE_URL
RemoteServer-->>BootstrapScript: Binary data
BootstrapScript->>FileSystem: Write binary to BINARY_PATH
BootstrapScript->>FileSystem: chmod +x BINARY_PATH
BootstrapScript->>BinutilsStrip: strip BINARY_PATH
BinutilsStrip-->>FileSystem: Stripped binary at BINARY_PATH
BootstrapScript->>BootstrapScript: file BINARY_PATH
BootstrapScript-->>User: Report installed binary type
Flow diagram for Docker image build with binutils installationflowchart TD
A[Base_image bluerobotics/blueos-base:0.2.2] --> B[Stage_download-binaries]
B --> C[Copy tools to /home/pi/tools]
C --> D[apt update]
D --> E[apt install -y --no-install-recommends binutils]
E --> F[Run install-static-binaries.sh]
F --> G[Image_with_tools_and_binutils]
subgraph Runtime_bootstrap_tools
H[Bootstrap_script] --> I[wget binary to BINARY_PATH]
I --> J[chmod +x BINARY_PATH]
J --> K[strip BINARY_PATH using binutils]
K --> L[Stripped_binary_ready]
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
saves ~40mb of ~346mb we currently have of rust binaries 🤔
Summary by Sourcery
Strip downloaded tool binaries in the core image to reduce disk usage.
Enhancements:
Build: