ARG BORG_ARCH FROM resin/${BORG_ARCH}-python:3.6-slim ARG BORG_ARCH ARG BORG_VERSION=1.1.7 ENV BORG_DIR /borg ENV BORG_BUILD_DIR ${BORG_DIR}/dist WORKDIR ${BORG_DIR} # install dev requirements RUN set -ex; \ apt-get update; \ apt-get install -y --no-install-recommends \ build-essential git \ fuse libfuse-dev pkg-config \ libssl-dev libacl1-dev \ zlib1g-dev liblz4-dev; \ rm -rf /var/lib/apt/lists/*; # fetch borg source code and update pip RUN set -ex; \ git clone -b ${BORG_VERSION} https://github.com/borgbackup/borg.git .; \ pip install --upgrade pip; # install borg + dependencies RUN set -ex; pip install -r requirements.d/development.txt; RUN set -ex; pip install -r requirements.d/fuse.txt; RUN set -ex; pip install -e .; # create standalone binary RUN set -ex; \ pip install pyinstaller; \ pyinstaller --log-level DEBUG -F -n borg-${BORG_ARCH} src/borg/__main__.py; RUN ln -s "${BORG_BUILD_DIR}/borg-${BORG_ARCH}" /usr/bin/borg