# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright 2017 Nils Tekampe # # This file is part of duplicity. # # Duplicity is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 2 of the License, or (at your # option) any later version. # # Duplicity is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with duplicity; if not, write to the Free Software Foundation, # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA FROM ubuntu:19.04 # Set locale to prevent UTF-8 errors ENV LANG C.UTF-8 ENV LC_ALL C.UTF-8 # Set to non-interactive so no tzdata prompt ARG DEBIAN_FRONTEND=noninteractive # Installing some pre-requisites and some # packages needed for testing duplicity RUN apt-get update \ && apt-get install -y \ 2to3 \ build-essential \ bzr \ intltool \ lftp \ librsync-dev \ libffi-dev \ libssl-dev \ openssl \ par2 \ python-dev \ python-pip \ python3-pip \ python3.7 \ python3.7-dev \ rdiff \ tzdata # required for testing/unit/test_statistics.py # The following packages are not necessary for testing but make life easier or support debugging RUN apt-get install -y \ ftp \ iputils-ping \ mc \ nano \ net-tools \ rsync \ && rm -rf /var/lib/apt/lists/* # Installing requirements w/pip COPY requirements.txt /tmp RUN pip install --requirement /tmp/requirements.txt # Delete root's password so we can do 'su -' RUN passwd --delete root # Install test user and swap to it RUN groupadd test && useradd -m -g test test USER test # Setting a working directory to home WORKDIR /home/test # Copy a SSH key to the users folder that is used for some test cases USER root COPY ./id_rsa /home/test/.ssh/ COPY ./id_rsa.pub /home/test/.ssh/ RUN chown -R test:test /home/test/.ssh RUN chmod 400 /home/test/.ssh/id_rsa USER test # Branch the duplicity repo for testing RUN bzr branch lp:duplicity duplicity # Set final workdir to duplicity WORKDIR /home/test/duplicity # Print revno we have installed CMD echo "duplicity is installed at revno `bzr revno`"