-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace Dockerfile Image with Scratch
- Loading branch information
Showing
6 changed files
with
684 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Use git CLI to fetch the source code instead of relying on the rust git implementation | ||
[net] | ||
git-fetch-with-cli = true |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
[package] | ||
name = "cp-utility" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
# No dependencies here | ||
|
||
[dev-dependencies] | ||
# dependencies only used during tests | ||
tempfile = "3.9.0" | ||
uuid = { version = "1.5.0", features = ["v4", "fast-rng"] } | ||
|
||
[profile.release] | ||
# Levers to optimize the binary for size | ||
strip = true # Strip symbols | ||
opt-level = "z" # Size optimization | ||
lto = true # linking time optimizations | ||
|
||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Introduction | ||
|
||
This copy utility is intended to be used as a base image for OpenTelemetry Operator | ||
autoinstrumentation images. The copy utility will allow the ADOT Java agent jar to be | ||
copied from the init container to the final destination volume. | ||
|
||
## Development | ||
|
||
### Pre-requirements | ||
* Install rust | ||
|
||
``` | ||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh | ||
``` | ||
|
||
* Install rustfmt | ||
|
||
``` | ||
rustup component add rustfmt | ||
``` | ||
|
||
### Development | ||
|
||
* Auto formatting the code | ||
|
||
This step is important and it might fail the build if the files are not properly | ||
formatted. | ||
|
||
``` | ||
cargo fmt | ||
``` | ||
|
||
* Testing the code | ||
``` | ||
cargo test | ||
``` | ||
|
||
* Building the code | ||
|
||
``` | ||
cargo build | ||
``` | ||
|
||
NOTE: this will build the code for tests locally. It will not statically link the libc used by it. | ||
|
||
|
||
* Building the code statically linked | ||
|
||
``` | ||
cargo build --target x86_64-unknown-linux-musl | ||
``` | ||
|
||
|
||
### Docker image | ||
|
||
In the root of this project, there is a Dockerfile that is supposed to be used during release. | ||
This Dockerfile can be used with buildx to generate images for the arm64 and x86_64 platforms. |
Oops, something went wrong.