Commit 8507294a authored by Clenimar Souza's avatar Clenimar Souza
Browse files

initial commit

Pipeline #1 failed with stages
in 0 seconds
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
name = "attestation-check"
version = "0.1.0"
name = "attestation-check"
version = "0.1.0"
authors = ["Clenimar Souza <>"]
edition = "2018"
# See more keys and their definitions at
FROM rust:1.49-alpine AS builder
RUN USER=root cargo new --bin attestation-check
WORKDIR ./attestation-check
COPY ./Cargo.toml ./Cargo.toml
RUN cargo build --release \
&& rm src/*.rs
COPY src ./src
RUN rm ./target/release/deps/attestation_check* \
&& cargo build --release
FROM alpine
COPY --from=builder /attestation-check/target/release/attestation-check /usr/local/bin/attestation-check
ENTRYPOINT /usr/local/bin/attestation-check
use std::env;
use std::net::TcpStream;
const CAS_ENV_KEY: &str = "SCONE_CAS_ADDR";
const LAS_ENV_KEY: &str = "SCONE_LAS_ADDR";
fn main() {
// Read environment variables.
let cas = env::var(CAS_ENV_KEY).expect("ERROR: SCONE_CAS_ADDR must be set");
let las = env::var(LAS_ENV_KEY).expect("ERROR: SCONE_LAS_ADDR must be set");
// Try to open a connection.
println!("Connecting to CAS at: {}", cas);
TcpStream::connect(format!("{}:18765", cas)).expect("Could not connect to CAS");
println!("OK: CAS is reachable");
println!("Connecting to LAS at: {}", las);
TcpStream::connect(format!("{}:18766", las)).expect("Could not connect to LAS");
println!("OK: LAS is reachable");
// Sockets are closed here.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment