Skip to content

Commit

Permalink
adding new compile flags
Browse files Browse the repository at this point in the history
  • Loading branch information
noahgift committed Mar 27, 2023
1 parent e1188e7 commit c477c88
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion distroless-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
clap = {version="4.0.32", features=["derive"]}
clap = {version="4.0.32", features=["derive"]}

[profile.release]
lto = true
codegen-units = 1
1 change: 1 addition & 0 deletions distroless-cli/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM rust:1.67.1 as build-env
ENV RUSTFLAGS="-C link-arg=-s -C lto -C codegen-units=1"
WORKDIR /app
COPY . /app
RUN cargo build --release
Expand Down
2 changes: 2 additions & 0 deletions distroless-cli/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ lint:
test:
cargo test --quiet

build-docker:
docker build -t distroless-cli .

run:
cargo run -- greet --name bob
Expand Down

0 comments on commit c477c88

Please sign in to comment.