Skip to content

Commit f25b4b0

Browse files
committed
Add Dockerfile
The Docker image is based on alpine. Usage: $ docker build -t hdcquery . $ docker run --rm hdcquery tags rust
1 parent d87a821 commit f25b4b0

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
target
2+
.git

Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM rust:1.48-alpine AS builder
2+
3+
RUN apk add --no-cache libc-dev openssl-dev
4+
5+
COPY . /src
6+
WORKDIR /src
7+
8+
RUN RUSTFLAGS="-C target-feature=-crt-static" cargo build --release
9+
RUN strip target/release/hdcquery
10+
11+
12+
13+
FROM alpine
14+
15+
RUN apk add --no-cache libgcc
16+
17+
COPY --from=builder /src/target/release/hdcquery /usr/local/bin/
18+
19+
USER nobody
20+
21+
ENTRYPOINT [ "/usr/local/bin/hdcquery" ]

0 commit comments

Comments
 (0)