diff --git a/Dockerfile b/Dockerfile index 5e25a81..323dc44 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:stretch +FROM python:3-stretch MAINTAINER Justin Wong RUN echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ stretch main contrib non-free" > /etc/apt/sources.list && \ @@ -7,16 +7,16 @@ RUN echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ stretch main contrib n echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian-security/ stretch/updates main contrib non-free" >> /etc/apt/sources.list RUN apt-get update && \ - apt-get install -y wget curl rsync lftp git jq python-dev python-pip yum-utils createrepo python3-dev python3-pip aria2 + apt-get install -y wget curl rsync lftp git jq python-dev python-pip yum-utils createrepo aria2 -RUN pip3 install bandersnatch==2.2.1 +RUN pip3 install bandersnatch==3.1.2 +RUN STATIC_DEPS=true pip3 install pyquery RUN pip3 install requests pyyaml RUN mkdir -p /home/tunasync-scripts ADD https://storage.googleapis.com/git-repo-downloads/repo /usr/local/bin/aosp-repo RUN chmod a+x /usr/local/bin/aosp-repo -RUN apt-get install -y python3-lxml && pip3 install pyquery RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && apt-get install -y locales -qq && locale-gen ENV LANG=en_US.UTF-8 diff --git a/pypi.sh b/pypi.sh index 39ace1d..c86f3eb 100755 --- a/pypi.sh +++ b/pypi.sh @@ -16,12 +16,14 @@ if [[ $INIT == "0" ]]; then [mirror] directory = ${TUNASYNC_WORKING_DIR} master = ${TUNASYNC_UPSTREAM} +json = true timeout = 15 workers = 10 -stop-on-error = true +hash-index = false +stop-on-error = false delete-packages = true EOF - /usr/bin/timeout -s INT 7200 $BANDERSNATCH -c $CONF mirror + /usr/bin/timeout -s INT 36000 $BANDERSNATCH -c $CONF mirror if [[ $? == 124 ]]; then echo 'Sync timeout (/_\\)' exit 1 @@ -31,8 +33,10 @@ else [mirror] directory = ${TUNASYNC_WORKING_DIR} master = ${TUNASYNC_UPSTREAM} +json = true timeout = 15 workers = 10 +hash-index = false stop-on-error = false delete-packages = false EOF