This commit is contained in:
parent
279da28323
commit
1a4ae07e6b
5 changed files with 14 additions and 20 deletions
3
.cargo/config.toml
Normal file
3
.cargo/config.toml
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
[target.x86_64-unknown-linux-gnu]
|
||||||
|
linker = "clang"
|
||||||
|
rustflags = ["-Clink-arg=-fuse-ld=mold"]
|
12
Cargo.lock
generated
12
Cargo.lock
generated
|
@ -1317,7 +1317,6 @@ dependencies = [
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"time",
|
"time",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tokio-stream",
|
|
||||||
"tracing",
|
"tracing",
|
||||||
"tracing-subscriber",
|
"tracing-subscriber",
|
||||||
]
|
]
|
||||||
|
@ -1483,17 +1482,6 @@ dependencies = [
|
||||||
"syn",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "tokio-stream"
|
|
||||||
version = "0.1.14"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842"
|
|
||||||
dependencies = [
|
|
||||||
"futures-core",
|
|
||||||
"pin-project-lite",
|
|
||||||
"tokio",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tokio-util"
|
name = "tokio-util"
|
||||||
version = "0.7.10"
|
version = "0.7.10"
|
||||||
|
|
|
@ -23,6 +23,5 @@ tempfile = "3"
|
||||||
thiserror = "1"
|
thiserror = "1"
|
||||||
time = { version = "0.3", features = ["serde"] }
|
time = { version = "0.3", features = ["serde"] }
|
||||||
tokio = { version = "1", features = ["full"] }
|
tokio = { version = "1", features = ["full"] }
|
||||||
tokio-stream = "0.1"
|
|
||||||
tracing = "0.1"
|
tracing = "0.1"
|
||||||
tracing-subscriber = "0.3"
|
tracing-subscriber = "0.3"
|
||||||
|
|
|
@ -1,13 +1,16 @@
|
||||||
FROM public.ecr.aws/docker/library/rust:1-alpine as builder
|
FROM public.ecr.aws/docker/library/rust:1-alpine as builder
|
||||||
|
|
||||||
RUN rustup default stable
|
RUN rustup default stable
|
||||||
RUN apk add --no-cache musl-dev openssl-dev openssl-libs-static pkgconf git
|
RUN apk add --no-cache musl-dev openssl-dev openssl-libs-static pkgconf git mold clang
|
||||||
|
|
||||||
# Set `SYSROOT` to a dummy path (default is /usr) because pkg-config-rs *always*
|
# Set `SYSROOT` to a dummy path (default is /usr) because pkg-config-rs *always*
|
||||||
# links those located in that path dynamically but we want static linking, c.f.
|
# links those located in that path dynamically but we want static linking, c.f.
|
||||||
# https://github.com/rust-lang/pkg-config-rs/blob/54325785816695df031cef3b26b6a9a203bbc01b/src/lib.rs#L613
|
# https://github.com/rust-lang/pkg-config-rs/blob/54325785816695df031cef3b26b6a9a203bbc01b/src/lib.rs#L613
|
||||||
ENV SYSROOT=/dummy
|
ENV SYSROOT=/dummy
|
||||||
|
|
||||||
|
# Compilation speedup
|
||||||
|
ENV CARGO_INCREMENTAL=0
|
||||||
|
|
||||||
WORKDIR /wd
|
WORKDIR /wd
|
||||||
COPY . /wd
|
COPY . /wd
|
||||||
RUN cargo build --release --target=x86_64-unknown-linux-musl
|
RUN cargo build --release --target=x86_64-unknown-linux-musl
|
||||||
|
|
13
src/main.rs
13
src/main.rs
|
@ -54,16 +54,17 @@ async fn main() -> Result<()> {
|
||||||
_ = dotenvy::dotenv();
|
_ = dotenvy::dotenv();
|
||||||
tracing_subscriber::fmt::init();
|
tracing_subscriber::fmt::init();
|
||||||
|
|
||||||
// Try to connect to docker server
|
|
||||||
let docker = Docker::connect_with_local_defaults()?;
|
|
||||||
// Ping to make sure it works
|
|
||||||
let version = docker.version().await?;
|
|
||||||
tracing::info!("docker version: {}", version.version.unwrap());
|
|
||||||
|
|
||||||
// Parse args
|
// Parse args
|
||||||
let args = Args::parse();
|
let args = Args::parse();
|
||||||
tracing::info!("listening on {}", &args.bind);
|
tracing::info!("listening on {}", &args.bind);
|
||||||
|
|
||||||
|
// Try to connect to docker server
|
||||||
|
let docker = Docker::connect_with_local_defaults()?;
|
||||||
|
|
||||||
|
// Ping to make sure it works
|
||||||
|
let version = docker.version().await?;
|
||||||
|
tracing::info!("docker version: {}", version.version.unwrap());
|
||||||
|
|
||||||
let (author_name, author_email) = parse_author(&args.git_author)?;
|
let (author_name, author_email) = parse_author(&args.git_author)?;
|
||||||
let gitconfig = GitConfig {
|
let gitconfig = GitConfig {
|
||||||
author_name,
|
author_name,
|
||||||
|
|
Reference in a new issue