-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
65 lines (49 loc) · 1.81 KB
/
Dockerfile
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# docker run --rm -it -v $(pwd):/src -v /run/pcscd/pcscd.comm:/run/pcscd/pcscd.comm mihaigalos/pass
FROM rust:alpine as base
ARG USER
RUN apk update \
&& apk add \
git \
gcc \
g++ \
gpg \
pcsc-lite-dev \
openssl \
openssl-dev \
pkgconfig
COPY . /src
WORKDIR /src
RUN git clone --depth 1 https://github.com/str4d/age-plugin-yubikey.git \
&& cd age-plugin-yubikey \
&& RUSTFLAGS="-C target-feature=-crt-static" cargo build --release
RUN git clone --depth 1 https://github.com/casey/just.git \
&& cd just \
&& RUSTFLAGS="-C target-feature=-crt-static" cargo build --release
RUN git clone --depth 1 https://github.com/mihaigalos/qr2term-rs.git \
&& cd qr2term-rs \
&& RUSTFLAGS="-C target-feature=-crt-static" cargo build --release --example example-read
RUN git clone --depth 1 https://github.com/str4d/rage.git \
&& cd rage \
&& RUSTFLAGS="-C target-feature=-crt-static" cargo build --release
RUN git clone --depth 1 https://github.com/mihaigalos/randompass.git \
&& cd randompass \
&& RUSTFLAGS="-C target-feature=-crt-static" cargo build --release
FROM alpine:3.18 as tool
ARG USER
RUN apk update \
&& apk add \
bash \
git \
libgcc \
openssh-client \
pcsc-lite-dev
COPY --from=base /src/age-plugin-yubikey/target/release/age-plugin-yubikey /usr/local/bin/
COPY --from=base /src/just/target/release/just /usr/local/bin/
COPY --from=base /src/qr2term-rs/target/release/examples/example-read /usr/local/bin/qr2term
COPY --from=base /src/rage/target/release/rage* /usr/local/bin/
COPY --from=base /src/randompass/target/release/randompass /usr/local/bin/
RUN addgroup -S ${USER} -g 1000 && adduser -S ${USER} -G ${USER} -u 1000
USER ${USER}
WORKDIR /src
ENTRYPOINT [ "just" ]
CMD [ "help" ]