Skip to content

Commit

Permalink
add dockerfile
Browse files Browse the repository at this point in the history
Add a basic but working dockerfile.

In service of #217

To build image, 
`docker build -t mdq:1.0 .`

Sample usage:
`cat examples/hello.md | docker run --rm -i mdq:1.0 '# Greetings' `

---------

Co-authored-by: Whispard <johndoe@example.com>
  • Loading branch information
Whispard and Whispard authored Feb 27, 2025
1 parent 2670dcb commit 37aa8fd
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
target
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM rust:alpine AS builder

WORKDIR /usr/src/app
RUN apk add --no-cache build-base

COPY Cargo.toml Cargo.lock ./
RUN mkdir src && echo "fn main() {}" > src/main.rs
RUN cargo build --release && rm -rf src

COPY . .
RUN cargo build --release

FROM alpine:latest

COPY --from=builder /usr/src/app/target/release/mdq .

RUN chmod +x mdq

ENTRYPOINT ["./mdq"]

0 comments on commit 37aa8fd

Please sign in to comment.