How to containerize a rust warp app

I wrote this arti warp server for running whois via TOR network, Arti is CLI tool which has arti_client library inside for connecting the network, my main target to dockerize this for easy deploy to koyeb.com I used docker init to create Dockerfile and others and changed the implementation little bit because of some special dependencies ARG RUST_VERSION=1.82.0 ARG APP_NAME=arti_whois FROM rust:${RUST_VERSION}-alpine AS build ARG APP_NAME WORKDIR /app # Install host build dependencies. RUN apk add --no-cache clang lld musl-dev git openssl-dev openssl libssl3 libcrypto3 libgcrypt openssl-libs-static ca-certificates RUN --mount=type=bind,source=src,target=src \ --mount=type=bind,source=Cargo.toml,target=Cargo.toml \ --mount=type=bind,source=Cargo.lock,target=Cargo.lock \ --mount=type=cache,target=/app/target/ \ --mount=type=cache,target=/usr/local/cargo/git/db \ --mount=type=cache,target=/usr/local/cargo/registry/ \ cargo build --locked --release && \ cp ./target/release/$APP_NAME /bin/server FROM alpine:3.18 AS final USER root COPY --from=build /bin/server /bin/ EXPOSE 8016 ENV RUST_BACKTRACE=1 ENV RUST_LOG=debug CMD ["/bin/server"] apk add part took a while to figure out because on every run, compile was failing with different error, I needed to install all the dev lib dependencies to the alpine linux 2. Test with docker compose up --build until everything is fine. I was using curl for testing the app curl "localhost:8016/whois?ip=1.1.1.1" -v 3. Than docker push ozkanpakdil/arti_whois to push it to docker repository ...

December 23, 2024 · 1 min · Özkan Pakdil

Using arti to Connect to TOR Network and query WHOIS information in Rust

This code is a web application that allows querying WHOIS information over the TOR network. It uses the arti library to create and manage the tor connection and tor-rtcompat to define the runtime for the tor connection. The arti library provides a simple way to connect to the TOR network and make requests through it. It also allows to define the behavior of the tor connection, like in this case OnDemand, which only establishes the connection when it is needed. ...

January 14, 2023 · 2 min · Özkan Pakdil

Java microservice framework tests in SB:2.6.4 Q:2.7.4.Final M:3.3.4 V:4.2.5 H:2.4.2 openjdk version "11.0.14" 2022-01-18 LTS

Here is total package generation times for separate modules, [INFO] eclipse-microprofile-kumuluz-test 1.0-SNAPSHOT ..... SUCCESS [ 19.645 s] [INFO] helidon-quickstart-se 1.0-SNAPSHOT ................. SUCCESS [ 28.868 s] [INFO] micronaut-demo 0.1 ................................. SUCCESS [ 27.438 s] [INFO] quarkus-demo 1.0.0-SNAPSHOT ........................ SUCCESS [ 36.631 s] [INFO] springboot-demo 0.0.1-SNAPSHOT ..................... SUCCESS [ 8.561 s] [INFO] vertx-demo 1.0.0-SNAPSHOT .......................... SUCCESS [ 14.427 s] Size of created packages: Size in MB Name 22M eclipse-microprofile-kumuluz-test/target/eclipse-microprofile-kumuluz-test-1.0-SNAPSHOT.jar 7.6M helidon-se-netty/target/helidon-quickstart-se.jar 11K helidon-se-netty/target/original-helidon-quickstart-se.jar 14M micronaut/target/micronaut-demo-0.1.jar 11K micronaut/target/original-micronaut-demo-0.1.jar 15M quarkus/target/quarkus-demo-1.0.0-SNAPSHOT-runner.jar 21M spring-boot/target/springboot-demo-0.0.1-SNAPSHOT.jar 7.5M vertx/target/vertx-demo-1.0.0-SNAPSHOT-fat.jar 6.8K vertx/target/vertx-demo-1.0.0-SNAPSHOT.jar :: Spring Boot :: (v2.6.4) Started DemoApplication in 2.851 seconds (JVM running for 3.593) ---- Global Information -------------------------------------------------------- > request count 2000 (OK=2000 KO=0 ) > min response time 0 (OK=0 KO=- ) > max response time 404 (OK=404 KO=- ) > mean response time 80 (OK=80 KO=- ) > std deviation 97 (OK=97 KO=- ) > response time 50th percentile 24 (OK=24 KO=- ) > response time 75th percentile 143 (OK=143 KO=- ) > response time 95th percentile 280 (OK=280 KO=- ) > response time 99th percentile 324 (OK=324 KO=- ) > mean requests/sec 400 (OK=400 KO=- ) ...

4 min · Özkan Pakdil

Java microservice framework tests in SB:2.6.4 Q:2.7.4.Final M:3.3.4 V:4.2.5 H:2.4.2 openjdk version "11.0.14" 2022-01-18 LTS

Here is total package generation times for separate modules, [INFO] eclipse-microprofile-kumuluz-test 1.0-SNAPSHOT ..... SUCCESS [ 16.841 s] [INFO] helidon-quickstart-se 1.0-SNAPSHOT ................. SUCCESS [ 23.900 s] [INFO] micronaut-demo 0.1 ................................. SUCCESS [ 22.459 s] [INFO] quarkus-demo 1.0.0-SNAPSHOT ........................ SUCCESS [ 30.602 s] [INFO] springboot-demo 0.0.1-SNAPSHOT ..................... SUCCESS [ 6.571 s] [INFO] vertx-demo 1.0.0-SNAPSHOT .......................... SUCCESS [ 13.375 s] Size of created packages: Size in MB Name 22M eclipse-microprofile-kumuluz-test/target/eclipse-microprofile-kumuluz-test-1.0-SNAPSHOT.jar 7.6M helidon-se-netty/target/helidon-quickstart-se.jar 11K helidon-se-netty/target/original-helidon-quickstart-se.jar 14M micronaut/target/micronaut-demo-0.1.jar 11K micronaut/target/original-micronaut-demo-0.1.jar 15M quarkus/target/quarkus-demo-1.0.0-SNAPSHOT-runner.jar 21M spring-boot/target/springboot-demo-0.0.1-SNAPSHOT.jar 7.5M vertx/target/vertx-demo-1.0.0-SNAPSHOT-fat.jar 6.8K vertx/target/vertx-demo-1.0.0-SNAPSHOT.jar :: Spring Boot :: (v2.6.4) Started DemoApplication in 2.385 seconds (JVM running for 2.969) ---- Global Information -------------------------------------------------------- > request count 4000 (OK=4000 KO=0 ) > min response time 0 (OK=0 KO=- ) > max response time 672 (OK=672 KO=- ) > mean response time 246 (OK=246 KO=- ) > std deviation 184 (OK=184 KO=- ) > response time 50th percentile 234 (OK=234 KO=- ) > response time 75th percentile 385 (OK=385 KO=- ) > response time 95th percentile 565 (OK=565 KO=- ) > response time 99th percentile 616 (OK=616 KO=- ) > mean requests/sec 800 (OK=800 KO=- ) ...

4 min · Özkan Pakdil

Java microservice framework tests in SB:2.6.4 Q:2.7.4.Final M:3.3.4 V:4.2.5 H:2.4.2 openjdk version "17.0.2" 2022-01-18 LTS

Here is total package generation times for separate modules, [INFO] eclipse-microprofile-kumuluz-test 1.0-SNAPSHOT ..... SUCCESS [ 15.205 s] [INFO] helidon-quickstart-se 1.0-SNAPSHOT ................. SUCCESS [ 23.018 s] [INFO] micronaut-demo 0.1 ................................. SUCCESS [ 20.745 s] [INFO] quarkus-demo 1.0.0-SNAPSHOT ........................ SUCCESS [ 28.491 s] [INFO] springboot-demo 0.0.1-SNAPSHOT ..................... SUCCESS [ 6.348 s] [INFO] vertx-demo 1.0.0-SNAPSHOT .......................... SUCCESS [ 12.369 s] Size of created packages: Size in MB Name 22M eclipse-microprofile-kumuluz-test/target/eclipse-microprofile-kumuluz-test-1.0-SNAPSHOT.jar 7.6M helidon-se-netty/target/helidon-quickstart-se.jar 11K helidon-se-netty/target/original-helidon-quickstart-se.jar 14M micronaut/target/micronaut-demo-0.1.jar 11K micronaut/target/original-micronaut-demo-0.1.jar 15M quarkus/target/quarkus-demo-1.0.0-SNAPSHOT-runner.jar 21M spring-boot/target/springboot-demo-0.0.1-SNAPSHOT.jar 7.5M vertx/target/vertx-demo-1.0.0-SNAPSHOT-fat.jar 6.8K vertx/target/vertx-demo-1.0.0-SNAPSHOT.jar :: Spring Boot :: (v2.6.4) Started DemoApplication in 2.2 seconds (JVM running for 2.671) ---- Global Information -------------------------------------------------------- > request count 2000 (OK=2000 KO=0 ) > min response time 0 (OK=0 KO=- ) > max response time 228 (OK=228 KO=- ) > mean response time 23 (OK=23 KO=- ) > std deviation 41 (OK=41 KO=- ) > response time 50th percentile 2 (OK=2 KO=- ) > response time 75th percentile 23 (OK=23 KO=- ) > response time 95th percentile 121 (OK=121 KO=- ) > response time 99th percentile 168 (OK=168 KO=- ) > mean requests/sec 400 (OK=400 KO=- ) ...

4 min · Özkan Pakdil