forked from wisespace-io/yubico-rs
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (25 loc) · 565 Bytes
/
Dockerfile
File metadata and controls
33 lines (25 loc) · 565 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Change to build a different example, like otp_async
ARG EXAMPLE=otp
FROM rust:alpine as base
ARG EXAMPLE
RUN apk --no-cache add \
git \
gcc \
g++ \
openssl \
openssl-dev \
pkgconfig
COPY . /src
WORKDIR /src
ENV RUSTFLAGS="-C target-feature=-crt-static"
RUN cargo build \
--release \
--example "${EXAMPLE}"
FROM alpine:3
ARG EXAMPLE
RUN apk --no-cache add \
libgcc \
pcsc-lite-dev
COPY --from=base "/src/target/release/examples/${EXAMPLE}" /usr/local/bin/otp
ENV RUST_BACKTRACE=1
ENTRYPOINT [ "/usr/local/bin/otp" ]