Dockerfile 967 Bytes
Newer Older
noplanman's avatar
noplanman committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
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/*;

# install borg + dependencies
RUN set -ex; \
    git clone https://github.com/borgbackup/borg.git .; \
    git checkout ${BORG_VERSION}; \
    pip install --upgrade pip;

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