tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

Dockerfile (3546B)


      1 ARG BASE_IMAGE
      2 FROM $BASE_IMAGE
      3 MAINTAINER Mike Hommey <mhommey@mozilla.com>
      4 
      5 ENV DEBIAN_FRONTEND=noninteractive
      6 
      7 # Set a default command useful for debugging
      8 CMD ["/bin/bash", "--login"]
      9 
     10 # %include taskcluster/docker/recipes/setup_packages.sh
     11 COPY topsrcdir/taskcluster/docker/recipes/setup_packages.sh /usr/local/sbin/
     12 # %include taskcluster/docker/recipes/clean_packages.sh
     13 COPY topsrcdir/taskcluster/docker/recipes/clean_packages.sh /usr/local/sbin/
     14 
     15 COPY taskcluster-hack.sh /usr/local/sbin
     16 COPY snapshot-hack.py /usr/local/sbin
     17 COPY gpgvnoexpkeysig /usr/local/sbin
     18 
     19 ARG DIST
     20 ARG SNAPSHOT
     21 ARG TASKCLUSTER_ROOT_URL
     22 
     23 RUN if [ -f /etc/apt/sources.list.d/ubuntu.sources ]; then mv /etc/apt/sources.list.d/ubuntu.sources /etc/apt/; fi;
     24 
     25 # Set apt sources list to a snapshot.
     26 # Note: the use of gpgvnoexpkeysig is because the Debian Jessie GPG key expired.
     27 RUN if [ -n "$DIST" ]; then for s in debian_$DIST debian_$DIST-updates debian_$DIST-backports debian-security_$DIST-security debian-debug_$DIST-debug debian-debug_$DIST-proposed-updates-debug debian-debug_$DIST-backports-debug; do \
     28      case "$s" in \
     29      debian-debug_jessie*|debian_jessie-updates) \
     30          : No debian-debug/updates archive for Jessie; \
     31          ;; \
     32      debian-security_jessie-security) \
     33          echo "deb http://archive.debian.org/debian-security/ jessie/updates main"; \
     34          ;; \
     35      debian-security_buster-security) \
     36          echo "deb http://archive.debian.org/debian-security/ buster/updates main"; \
     37          ;; \
     38      debian*_jessie*|debian*_buster*) \
     39          echo "deb http://archive.debian.org/${s%_*}/ ${s#*_} main"; \
     40          ;; \
     41      *) \
     42          echo "deb http://snapshot.debian.org/archive/${s%_*}/$SNAPSHOT/ ${s#*_} main"; \
     43          ;; \
     44      esac; \
     45    done > /etc/apt/sources.list ; fi && \
     46    rm -f /etc/apt/sources.list.d/* && \
     47    ( echo 'quiet "true";'; \
     48      echo 'APT::Get::Assume-Yes "true";'; \
     49      echo 'APT::Install-Recommends "false";'; \
     50      echo 'Acquire::Check-Valid-Until "false";'; \
     51      echo 'Acquire::Retries "5";'; \
     52      if dpkg --compare-versions $(apt --version | awk '{print $2}') ge 2.1.15; then \
     53        echo 'dir::bin::methods::https "/usr/local/sbin/taskcluster-hack.sh";'; \
     54      fi; \
     55      if [ "$DIST" = "jessie" ]; then \
     56        echo 'Dir::Bin::gpg "/usr/local/sbin/gpgvnoexpkeysig";'; \
     57      fi; \
     58    ) > /etc/apt/apt.conf.d/99taskcluster && \
     59    ( echo 'Package: *'; \
     60      echo 'Pin: origin "'$TASKCLUSTER_ROOT_URL'"' | sed 's,https://,,'; \
     61      echo 'Pin-Priority: 1001'; \
     62    ) > /etc/apt/preferences.d/99taskcluster
     63 
     64 RUN if [ -f /etc/apt/ubuntu.sources ]; then mv /etc/apt/ubuntu.sources /etc/apt/sources.list.d/; fi;
     65 
     66 RUN apt-get update && \
     67    if grep -q snapshot.debian.org /etc/apt/sources.list; then \
     68      apt-get install python3-minimal libpython3-stdlib; \
     69      echo 'dir::bin::methods::http "/usr/local/sbin/snapshot-hack.py";' >> /etc/apt/apt.conf.d/99taskcluster; \
     70    fi && \
     71    apt-get install \
     72      apt-transport-https \
     73      ca-certificates && \
     74    if [ -n "$SNAPSHOT" -a -f /etc/apt/sources.list.d/ubuntu.sources ]; then \
     75      echo "APT::Snapshot \"$SNAPSHOT\";" > /etc/apt/apt.conf.d/99snapshot && \
     76      ( echo 'Package: *'; \
     77        echo 'Pin: origin "snapshot.ubuntu.com"'; \
     78        echo 'Pin-Priority: 1001'; \
     79      ) > /etc/apt/preferences.d/90snapshot && \
     80      downgrades=--allow-downgrades && \
     81      apt-get update; fi && \
     82    apt-get dist-upgrade ${downgrades} && \
     83    rm -f /etc/apt/preferences.d/90snapshot