File: docker-rust.rs

package info (click to toggle)
rust-scriptisto 2.2.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 436 kB
  • sloc: python: 25; ansic: 16; java: 11; pascal: 9; cpp: 8; javascript: 8; cs: 7; cobol: 5; lisp: 5; f90: 5; makefile: 4; ml: 4; haskell: 2
file content (24 lines) | stat: -rwxr-xr-x 632 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env scriptisto

// scriptisto-begin
// script_src: src/main.rs
// build_cmd: "cargo build --release && cp ./target/*musl*/release/script ./target/script"
// target_bin: ./target/script
// docker_build:
//    dockerfile: FROM clux/muslrust
//    src_mount_dir: /volume
//    extra_args: [-v,cargo-cache:/root/.cargo/registry]
// files:
//  - path: Cargo.toml
//    content: |
//     package = { name = "script", version = "0.1.0", edition = "2018"}
//     [dependencies]
//     rand="*"
// scriptisto-end

fn main() {
    println!(
        "Hello, Rust built in Docker! Random: {}",
        rand::random::<u64>()
    );
}