Skip to content

Commit

Permalink
Merge pull request #52 from ynqa/dockerfile
Browse files Browse the repository at this point in the history
Update Dockerfile
  • Loading branch information
ynqa committed Aug 7, 2024
2 parents 80ae4fd + 66f57d2 commit aa43883
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 18 deletions.
19 changes: 6 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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 image

FROM scratch
# Final stage
FROM debian:bookworm-slim

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 changes: 17 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,21 +75,33 @@ See [package entry on search.nixos.org](https://search.nixos.org/packages?channe
nix-shell -p jnv
```

### Cargo
### Docker

Build
(In the near future, the image will be available on something of registries)

```bash
cargo install jnv
docker build -t jnv .
```

## Examples
And Run
(The following commad is just an example. Please modify the path to the file you want to mount)

```bash
cat data.json | jnv
docker run -it --rm -v $(pwd)/debug.json:/jnv/debug.json jnv /jnv/debug.json
```

Or
### Cargo

```bash
cargo install jnv
```

## Examples

```bash
cat data.json | jnv
# or
jnv data.json
```

Expand Down

0 comments on commit aa43883

Please sign in to comment.