mirror of
https://github.com/ynqa/jnv.git
synced 2026-01-06 03:09:29 -06:00
19
Dockerfile
19
Dockerfile
@@ -1,20 +1,13 @@
|
||||
## Build stage
|
||||
FROM rust:1.79-alpine3.20 as builder
|
||||
|
||||
RUN rustup target add x86_64-unknown-linux-musl
|
||||
|
||||
RUN apk add musl-dev
|
||||
# Build stage
|
||||
FROM rust:1.80.0-slim-bookworm as builder
|
||||
|
||||
WORKDIR /jnv
|
||||
|
||||
COPY . /jnv
|
||||
RUN cargo build --release
|
||||
|
||||
RUN cargo build --target=x86_64-unknown-linux-musl --release
|
||||
# Final stage
|
||||
FROM debian:bookworm-slim
|
||||
|
||||
## Final image
|
||||
|
||||
FROM scratch
|
||||
|
||||
COPY --from=builder /jnv/target/x86_64-unknown-linux-musl/release/jnv /bin/jnv
|
||||
COPY --from=builder /jnv/target/release/jnv /bin/jnv
|
||||
|
||||
ENTRYPOINT ["/bin/jnv"]
|
||||
|
||||
22
README.md
22
README.md
@@ -75,6 +75,22 @@ See [package entry on search.nixos.org](https://search.nixos.org/packages?channe
|
||||
nix-shell -p jnv
|
||||
```
|
||||
|
||||
### Docker
|
||||
|
||||
Build
|
||||
(In the near future, the image will be available on something of registries)
|
||||
|
||||
```bash
|
||||
docker build -t jnv .
|
||||
```
|
||||
|
||||
And Run
|
||||
(The following commad is just an example. Please modify the path to the file you want to mount)
|
||||
|
||||
```bash
|
||||
docker run -it --rm -v $(pwd)/debug.json:/jnv/debug.json jnv /jnv/debug.json
|
||||
```
|
||||
|
||||
### Cargo
|
||||
|
||||
```bash
|
||||
@@ -85,11 +101,7 @@ cargo install jnv
|
||||
|
||||
```bash
|
||||
cat data.json | jnv
|
||||
```
|
||||
|
||||
Or
|
||||
|
||||
```bash
|
||||
# or
|
||||
jnv data.json
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user