-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Rust Example #462
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
briandealwis
merged 16 commits into
GoogleContainerTools:master
from
blhagadorn:rust-example
Feb 27, 2020
Merged
Rust Example #462
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
284ea0d
Added Distroless Dockerfile
blhagadorn 14feb34
Added cargo package folders and simple hello world
blhagadorn 5ca160b
Added correct package name
blhagadorn 0dc1865
Update README to include rust
blhagadorn 2f61d21
Added BUILD file to Rust example
blhagadorn b4790ca
Added notice
blhagadorn 3df80aa
Added new line for Rust example BUILD
blhagadorn 0724689
Added capitalized version of Rust
blhagadorn a824a35
Added WORKSPACE changes to include rules_rust
blhagadorn bedb9e8
Moved bazel rules
blhagadorn 9069716
Formatting
blhagadorn 9d1d395
Merge remote-tracking branch 'upstream/master' into rust-example
blhagadorn 823ab34
Modified WORKSPACE for Rust
blhagadorn 43b915e
Moved things around
blhagadorn d8d293c
Update BUILD
blhagadorn 84c2257
buildify formatting
blhagadorn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Public notice: this file is for internal documentation, testing, and | ||
# reference only. Note that repo maintainers can freely change any part of the | ||
# repository code at any time. | ||
package(default_visibility = ["//visibility:public"]) | ||
|
||
# Rust | ||
load("@io_bazel_rules_docker//rust:image.bzl", "rust_image") | ||
|
||
# NOTE: Bazel Rust rules don't support cross-compilation yet, | ||
# so at this time it's required that you build on the same platform as the image | ||
rust_image( | ||
name = "rust_example", | ||
srcs = ["src/main.rs"], | ||
base = "//cc:cc", | ||
) | ||
blhagadorn marked this conversation as resolved.
Show resolved
Hide resolved
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[package] | ||
name = "hello-world-distroless" | ||
version = "0.1.0" | ||
authors = ["Bryant Hagadorn <[email protected]>"] | ||
|
||
[dependencies] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM rust:1.41.0 as build-env | ||
WORKDIR /app | ||
ADD . /app | ||
RUN cargo build --release | ||
|
||
FROM gcr.io/distroless/cc | ||
COPY --from=build-env /app/target/release/hello-world-distroless / | ||
CMD ["./hello-world-distroless"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
fn main() { | ||
println!("Hello World!"); | ||
} |
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.
Uh oh!
There was an error while loading. Please reload this page.