#
# This container provides a full Python3-based installation of DataLad
# (http://datalad.org) using DataLad's latest development state at the
# time the container is built.
#
#######################################################################


Bootstrap:docker
From:neurodebian:latest

%post
    echo "Configuring the environment"
    apt-get -y update

    # setup the container sources themselves
    apt-get -y install eatmydata
    eatmydata apt-get -y install gnupg wget locales

    # we need a UTF locale for DataLad to work properly
    echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
    locale-gen

    # bare essentials to pull everything else in
    eatmydata apt-get -y install --no-install-recommends git git-annex-standalone python3-pip

    eatmydata apt-get -y install --no-install-recommends python3-setuptools python3-wheel less rsync git-remote-gcrypt aria2 libexempi3 rclone git-annex-remote-rclone p7zip-full

    # just for scrapy
    eatmydata apt-get -y install --no-install-recommends python3-twisted

    # little dance because pip cannot handle this url plus [full] in one go
    pip3 install --system 'datalad[full]'

    # clean up
    apt-get clean


%environments
    unset PYTHONPATH

%runscript
    datalad "$@"
