You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

60 lines
1.9 KiB

  1. ARG PYTHON_VERSION=3.7
  2. ARG ALPINE_VERSION=3.14
  3. # Build torsocks from source for the syscall fixes
  4. # Use Alpine 3.13 for compatibility with old Docker daemons (https://wiki.alpinelinux.org/wiki/Draft_Release_Notes_for_Alpine_3.14.0#faccessat2)
  5. FROM alpine:3.13 AS torsocks_build
  6. ARG TORSOCKS_VERSION=f9721f38aa78bcd249237c1777fde0e6743351ce
  7. RUN apk add --no-cache autoconf automake build-base gcc git libc-dev libtool make \
  8. && git clone https://gitlab.torproject.org/tpo/core/torsocks.git /torsocks \
  9. && cd /torsocks \
  10. && git checkout ${TORSOCKS_VERSION} \
  11. && ./autogen.sh \
  12. && ./configure \
  13. && make \
  14. && chmod 755 src/bin/torsocks
  15. # Based on https://github.com/ArchiveTeam/grab-site/pull/195
  16. FROM python:${PYTHON_VERSION}-alpine${ALPINE_VERSION}
  17. ARG GRAB_SITE_VERSION=2.2.3
  18. WORKDIR /app
  19. VOLUME [ "/data" ]
  20. RUN apk add --no-cache \
  21. git \
  22. gcc \
  23. libxml2-dev \
  24. musl-dev \
  25. libxslt-dev \
  26. g++ \
  27. re2-dev \
  28. libffi-dev \
  29. openssl-dev \
  30. patch \
  31. && ln -s /usr/include/libxml2/libxml /usr/include/libxml \
  32. && addgroup -S grab-site \
  33. && adduser -S -G grab-site grab-site \
  34. && chown -R grab-site:grab-site $(pwd) \
  35. && mkdir -p /data \
  36. && chown -R grab-site:grab-site /data
  37. COPY --from=torsocks_build /torsocks/src/bin/torsocks /usr/local/bin/torsocks
  38. COPY --from=torsocks_build /torsocks/src/lib/.libs/*.a /usr/local/lib/torsocks/
  39. COPY --from=torsocks_build /torsocks/src/lib/.libs/*.so* /usr/local/lib/torsocks/
  40. COPY --from=torsocks_build /torsocks/doc/torsocks.conf /usr/local/etc/tor/torsocks.conf
  41. USER grab-site:grab-site
  42. COPY --chown=grab-site:grab-site *.patch /tmp/grab-site-patches/
  43. RUN git clone https://github.com/ArchiveTeam/grab-site.git /app \
  44. && git checkout ${GRAB_SITE_VERSION} \
  45. && git apply --verbose /tmp/grab-site-patches/*.patch \
  46. && pip install --no-cache-dir . \
  47. && rm -rf /tmp/grab-site-patches
  48. COPY --chown=grab-site:grab-site entrypoint-jaa /app/entrypoint-jaa
  49. ENV PATH="/app:$PATH"
  50. ENTRYPOINT ["entrypoint-jaa"]
  51. WORKDIR /data