Dockerfile 862 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. FROM alpine:3.9 as build
  2. RUN apk add --no-cache \
  3. fuse3-dev \
  4. gcc \
  5. gpgme-dev \
  6. libc-dev \
  7. make \
  8. pkgconf
  9. RUN adduser -S build
  10. USER build
  11. COPY --chown=build:nogroup Makefile /rgpgfs/
  12. COPY --chown=build:nogroup src /rgpgfs/src
  13. WORKDIR /rgpgfs
  14. RUN make
  15. FROM build as test
  16. COPY --chown=build:nogroup tests /rgpgfs/tests
  17. RUN make tests/str && tests/str \
  18. && make tests/fs && tests/fs
  19. FROM alpine:3.9 as runtime
  20. RUN apk add --no-cache \
  21. fuse3 \
  22. gpgme
  23. RUN echo user_allow_other >> /etc/fuse.conf
  24. RUN adduser -S encrypt
  25. USER encrypt
  26. COPY --from=build /rgpgfs/rgpgfs /usr/local/bin/
  27. COPY --chown=encrypt:nogroup docker/ash_history /home/encrypt/.ash_history
  28. FROM runtime as unattended
  29. ENV RECIPIENT= \
  30. SOURCE_DIR=/plain \
  31. CIPHER_DIR=/encrypted
  32. COPY docker/rgpgfs_unattended.sh /
  33. CMD ["/rgpgfs_unattended.sh"]