Repository: ynqa/jnv (language: rust)

Issue:
feature request: Publish as a docker image
If published as a Docker image it can be used easily without depending on cargo or homebrew


Discussion / hints:
@jfisbein can you assign this to me ?

Sorry, only the project admin can assign the issue to you.
@ynqa 
@ynqa can you assign this to me ?

@VaishnavVerma cc @jfisbein Sorry for the delayed response, I have added you as an assignee.
@VaishnavVerma You might already be considering. I would appreciate it if you could make the image at runtime as small as possible using multi-stage builds. There might be other areas that can be optimized, but at the initial stage, this is my only request.
Since the person who offered to take this has turned into a ghost, is this up for grabs?

I took note of your comment about your wanting a minimal image.
@grodin It seems they've turned into a ghost without me noticing 👻 As of now, there's no one working on it.

Fix patch:
diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 0000000..eb5a316
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1,1 @@
+target
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..8744623
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,20 @@
+## Build stage
+FROM rust:1.79-alpine3.20 as builder
+
+RUN rustup target add x86_64-unknown-linux-musl
+
+RUN apk add musl-dev
+
+WORKDIR /jnv
+
+COPY . /jnv
+
+RUN cargo build --target=x86_64-unknown-linux-musl --release
+
+## Final image
+
+FROM scratch
+
+COPY --from=builder /jnv/target/x86_64-unknown-linux-musl/release/jnv /bin/jnv
+
+ENTRYPOINT ["/bin/jnv"]


Test patch: