-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
50 lines (33 loc) · 862 Bytes
/
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
FROM alpine:3.9 as build
RUN apk add --no-cache \
fuse3-dev \
gcc \
gpgme-dev \
libc-dev \
make \
pkgconf
RUN adduser -S build
USER build
COPY --chown=build:nogroup Makefile /rgpgfs/
COPY --chown=build:nogroup src /rgpgfs/src
WORKDIR /rgpgfs
RUN make
FROM build as test
COPY --chown=build:nogroup tests /rgpgfs/tests
RUN make tests/str && tests/str \
&& make tests/fs && tests/fs
FROM alpine:3.9 as runtime
RUN apk add --no-cache \
fuse3 \
gpgme
RUN echo user_allow_other >> /etc/fuse.conf
RUN adduser -S encrypt
USER encrypt
COPY --from=build /rgpgfs/rgpgfs /usr/local/bin/
COPY --chown=encrypt:nogroup docker/ash_history /home/encrypt/.ash_history
FROM runtime as unattended
ENV RECIPIENT= \
SOURCE_DIR=/plain \
CIPHER_DIR=/encrypted
COPY docker/rgpgfs_unattended.sh /
CMD ["/rgpgfs_unattended.sh"]