Verified Commit 0181f2d0 authored by noplanman's avatar noplanman
Browse files

New base image 1.1.14 built on Stretch with Python 3.5

parent 625e1b6f
ARG BORG_ARCH ARG BORG_ARCH
FROM balenalib/${BORG_ARCH}-python:3.5-jessie-run FROM balenalib/${BORG_ARCH}-python:3.5-stretch-run
ARG BORG_ARCH ARG BORG_ARCH
ARG BORG_VERSION=1.1.10 ARG BORG_VERSION=1.1.14
ENV BORG_DIR /borg ENV BORG_DIR /borg
ENV BORG_BUILD_DIR ${BORG_DIR}/dist ENV BORG_BUILD_DIR ${BORG_DIR}/dist
...@@ -12,26 +12,28 @@ WORKDIR ${BORG_DIR} ...@@ -12,26 +12,28 @@ WORKDIR ${BORG_DIR}
# install dev requirements # install dev requirements
RUN set -ex; \ RUN set -ex; \
apt-get update; \ apt-get update; \
apt-get upgrade; \
apt-get install -y --no-install-recommends \ apt-get install -y --no-install-recommends \
build-essential git \ build-essential git \
fuse libfuse-dev pkg-config \ fuse libfuse-dev pkg-config \
libssl-dev libacl1-dev \ libssl-dev libacl1-dev \
zlib1g-dev liblz4-dev; \ zlib1g-dev liblz4-dev \
libzstd-dev libffi-dev; \
rm -rf /var/lib/apt/lists/*; rm -rf /var/lib/apt/lists/*;
# fetch borg source code and update pip # fetch borg source code
RUN set -ex; \ RUN set -ex; \
git clone -b ${BORG_VERSION} https://github.com/borgbackup/borg.git .; \ git clone -b ${BORG_VERSION} https://github.com/borgbackup/borg.git .;
pip install --upgrade pip;
# install borg + dependencies # install all requirements
RUN set -ex; pip install -r requirements.d/development.txt; RUN set -ex; \
RUN set -ex; pip install -r requirements.d/fuse.txt; pip install -U pip pyinstaller wheel; \
RUN set -ex; pip install -e .[fuse]; pip install -r requirements.d/development.txt; \
pip install -r requirements.d/fuse.txt; \
pip install -e .[fuse];
# create standalone binary # create standalone binary
RUN set -ex; \ RUN set -ex; \
pip install pyinstaller; \
pyinstaller --log-level DEBUG -F -n borg-${BORG_ARCH} src/borg/__main__.py; 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 RUN ln -s "${BORG_BUILD_DIR}/borg-${BORG_ARCH}" /usr/bin/borg
# Base image to build the binaries from, based on BorgBackup version 1.1.10 # Base image to build the binaries from, based on BorgBackup version 1.1.14
ARG BORG_ARCH ARG BORG_ARCH
FROM balenalib/${BORG_ARCH}-python:3.5-jessie-run FROM balenalib/${BORG_ARCH}-python:3.5-stretch-run
ARG BORG_ARCH ARG BORG_ARCH
...@@ -13,21 +13,22 @@ WORKDIR ${BORG_DIR} ...@@ -13,21 +13,22 @@ WORKDIR ${BORG_DIR}
# install dev requirements # install dev requirements
RUN set -ex; \ RUN set -ex; \
apt-get update; \ apt-get update; \
apt-get upgrade; \
apt-get install -y --no-install-recommends \ apt-get install -y --no-install-recommends \
build-essential git \ build-essential git \
fuse libfuse-dev pkg-config \ fuse libfuse-dev pkg-config \
libssl-dev libacl1-dev \ libssl-dev libacl1-dev \
zlib1g-dev liblz4-dev; \ zlib1g-dev liblz4-dev \
libzstd-dev libffi-dev; \
rm -rf /var/lib/apt/lists/*; rm -rf /var/lib/apt/lists/*;
# fetch borg source code for version 1.1.10 and update pip # fetch borg source code for version 1.1.14
RUN set -ex; \ RUN set -ex; \
git clone -b 1.1.10 https://github.com/borgbackup/borg.git .; \ git clone -b 1.1.14 https://github.com/borgbackup/borg.git .;
pip install --upgrade pip;
# install all requirements # install all requirements
RUN set -ex; \ RUN set -ex; \
pip install -U pip pyinstaller wheel; \
pip install -r requirements.d/development.txt; \ pip install -r requirements.d/development.txt; \
pip install -r requirements.d/fuse.txt; \ pip install -r requirements.d/fuse.txt; \
pip install -e .[fuse]; \ pip install -e .[fuse];
pip install pyinstaller;
# HOT docker file, based on the prebuilt base image.
ARG BORG_ARCH ARG BORG_ARCH
FROM noplanman/borg-binary-builder:base-1.1.10-${BORG_ARCH} FROM noplanman/borg-binary-builder:base-1.1.14-${BORG_ARCH}
ARG BORG_ARCH ARG BORG_ARCH
ARG BORG_VERSION=1.1.10 ARG BORG_VERSION=1.1.14
ENV BORG_DIR /borg ENV BORG_DIR /borg
ENV BORG_BUILD_DIR ${BORG_DIR}/dist ENV BORG_BUILD_DIR ${BORG_DIR}/dist
WORKDIR ${BORG_DIR} WORKDIR ${BORG_DIR}
# upgrade system and dev requirements
RUN set -ex; \
apt-get update; \
apt-get upgrade;
# fetch latest borg source code for this version # fetch latest borg source code for this version
RUN set -ex; \ RUN set -ex; \
git fetch --all; \ git fetch --all; \
git checkout ${BORG_VERSION}; git checkout ${BORG_VERSION};
# install borg + dependencies # upgrade all requirements
RUN set -ex; \ RUN set -ex; \
pip install -U pip pyinstaller wheel; \
pip install -r requirements.d/development.txt; \ pip install -r requirements.d/development.txt; \
pip install -r requirements.d/fuse.txt; \ pip install -r requirements.d/fuse.txt; \
pip install -e .[fuse]; pip install -e .[fuse];
# create standalone binary # create standalone binary
RUN set -ex; \ RUN set -ex; \
pip install pyinstaller; \
pyinstaller --log-level DEBUG -F -n borg-${BORG_ARCH} src/borg/__main__.py; 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 RUN ln -s "${BORG_BUILD_DIR}/borg-${BORG_ARCH}" /usr/bin/borg
...@@ -11,9 +11,9 @@ Build [BorgBackup] binaries on any platform, for any architecture, using docker. ...@@ -11,9 +11,9 @@ Build [BorgBackup] binaries on any platform, for any architecture, using docker.
See the [list of available architectures] ([on GitHub][available-architectures-github]) See the [list of available architectures] ([on GitHub][available-architectures-github])
*Examples:* *Examples:*
- Build version `1.1.10` for `aarch64` - Build version `1.1.14` for `aarch64`
`./build.sh aarch64 1.1.10` `./build.sh aarch64 1.1.14`
- Build version `1.1.5` for Raspberry Pi 3 - Build version `1.1.5` for Raspberry Pi 3
...@@ -26,9 +26,9 @@ See the [list of available architectures] ([on GitHub][available-architectures-g ...@@ -26,9 +26,9 @@ See the [list of available architectures] ([on GitHub][available-architectures-g
**Note:** This will overwrite the file at `binary_save_location` if it already exists! **Note:** This will overwrite the file at `binary_save_location` if it already exists!
*Examples:* *Examples:*
- Extract borg `1.1.10` binary for `aarch64` to `borg-aarch64` in current folder - Extract borg `1.1.14` binary for `aarch64` to `borg-aarch64` in current folder
`./extract.sh aarch64 1.1.10 borg-aarch64` `./extract.sh aarch64 1.1.14 borg-aarch64`
- Extract borg `1.1.5` binary for Raspberry Pi 3 to `/homes/lemoi/borg` - Extract borg `1.1.5` binary for Raspberry Pi 3 to `/homes/lemoi/borg`
...@@ -38,7 +38,10 @@ See the [list of available architectures] ([on GitHub][available-architectures-g ...@@ -38,7 +38,10 @@ See the [list of available architectures] ([on GitHub][available-architectures-g
To speed up the building process, certain architectures have a prebuilt base image with the development requirements already installed. To speed up the building process, certain architectures have a prebuilt base image with the development requirements already installed.
These base images are based on BorgBackup version 1.1.0 *(for versions 1.1.0 to 1.1.9)* and 1.1.10 *(for versions 1.1.10 and later)*. These base images are based on BorgBackup versions:
- 1.1.14 *(for versions 1.1.14 and later)*
- 1.1.10 *(for versions 1.1.10 to 1.1.13)*
- 1.1.0 *(for versions 1.1.0 to 1.1.9)*
Adding a new architecture to the base image list and pushing it to docker hub: Adding a new architecture to the base image list and pushing it to docker hub:
...@@ -65,7 +68,7 @@ When using the base images created by `build-base.sh`, instead of using the norm ...@@ -65,7 +68,7 @@ When using the base images created by `build-base.sh`, instead of using the norm
The build then starts off with the prebuilt base image, speeding up the build tremendously. The build then starts off with the prebuilt base image, speeding up the build tremendously.
Builds are based on the Python 3.5 images on Debian Jessie. Builds are based on the Python 3.5 images on Debian Stretch (1.1.14 and later) and Jessie (1.1.0 to 1.1.13).
### Extract ### Extract
...@@ -78,13 +81,13 @@ This basically starts a container from the built image for your selected archite ...@@ -78,13 +81,13 @@ This basically starts a container from the built image for your selected archite
All automated binary builds can be found on Bintray: All automated binary builds can be found on Bintray:
- https://bintray.com/borg-binary-builder/borg-binaries/borg-binaries - https://bintray.com/borg-binary-builder/borg-binaries/borg-binaries
Using version `1.1.10` for `armv7` as an example: Using version `1.1.14` for `armv7` as an example:
1. Simply download the desired binary (`borg-1.1.10-armv7`) and it's corresponding signature file (`borg-1.1.10-armv7.asc`). 1. Simply download the desired binary (`borg-1.1.14-armv7`) and it's corresponding signature file (`borg-1.1.14-armv7.asc`).
2. Next we have to import the official PGP public key needed for verification (which you can find in this repo): 2. Next we have to import the official PGP public key needed for verification (which you can find in this repo):
- `gpg --import borg-binary-builder.public.asc` - `gpg --import borg-binary-builder.public.asc`
3. Then verify the downloaded binary with it's signature file: 3. Then verify the downloaded binary with it's signature file:
- `gpg --verify borg-1.1.10-armv7.asc borg-1.1.10-armv7` - `gpg --verify borg-1.1.14-armv7.asc borg-1.1.14-armv7`
4. Whoop! 4. Whoop!
## License ## License
......
...@@ -18,8 +18,7 @@ if [ -z "${BORG_ARCH}" ]; then ...@@ -18,8 +18,7 @@ if [ -z "${BORG_ARCH}" ]; then
exit 1; exit 1;
fi fi
DOCKER_IMAGE=noplanman/borg-binary-builder:base-1.1.10-${BORG_ARCH} DOCKER_IMAGE=noplanman/borg-binary-builder:base-1.1.14-${BORG_ARCH}
echo "Building ${DOCKER_IMAGE}" echo "Building ${DOCKER_IMAGE}"
# https://blog.hypriot.com/post/setup-simple-ci-pipeline-for-arm-images/ # https://blog.hypriot.com/post/setup-simple-ci-pipeline-for-arm-images/
...@@ -30,7 +29,7 @@ docker build \ ...@@ -30,7 +29,7 @@ docker build \
-t "${DOCKER_IMAGE}" \ -t "${DOCKER_IMAGE}" \
-f Dockerfile.base . -f Dockerfile.base .
# Output built borg binary version to assure the binary works. # Output built borg binary version to ensure the binary works.
docker run --rm "${DOCKER_IMAGE}" borg --version docker run --rm "${DOCKER_IMAGE}" borg --version
echo "Pushing to docker hub" echo "Pushing to docker hub"
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
set -ex set -ex
BORG_ARCH=${1} BORG_ARCH=${1}
BORG_VERSION=${2:-1.1.10} BORG_VERSION=${2:-1.1.14}
if [ -z "${BORG_ARCH}" ]; then if [ -z "${BORG_ARCH}" ]; then
echo "Usage: ./build.sh <arch> [<version>]"; echo "Usage: ./build.sh <arch> [<version>]";
...@@ -17,8 +17,6 @@ if [ -z "${BORG_ARCH}" ]; then ...@@ -17,8 +17,6 @@ if [ -z "${BORG_ARCH}" ]; then
fi fi
DOCKER_FILE=Dockerfile DOCKER_FILE=Dockerfile
DOCKER_IMAGE=borg:${BORG_VERSION}-${BORG_ARCH}
# For building the hot binary, make use of the prebuilt base docker image to speed things up. # For building the hot binary, make use of the prebuilt base docker image to speed things up.
# Note: Only a limited number of architectures are supported, check here: # Note: Only a limited number of architectures are supported, check here:
# https://hub.docker.com/r/noplanman/borg-binary-builder/tags/ # https://hub.docker.com/r/noplanman/borg-binary-builder/tags/
...@@ -26,6 +24,7 @@ if [ ! -z "${BBB_HOT}" ]; then ...@@ -26,6 +24,7 @@ if [ ! -z "${BBB_HOT}" ]; then
DOCKER_FILE=Dockerfile.hot DOCKER_FILE=Dockerfile.hot
fi fi
DOCKER_IMAGE=borg:${BORG_VERSION}-${BORG_ARCH}
echo "Building ${DOCKER_IMAGE}" echo "Building ${DOCKER_IMAGE}"
# https://blog.hypriot.com/post/setup-simple-ci-pipeline-for-arm-images/ # https://blog.hypriot.com/post/setup-simple-ci-pipeline-for-arm-images/
...@@ -37,5 +36,5 @@ docker build \ ...@@ -37,5 +36,5 @@ docker build \
-t "${DOCKER_IMAGE}" \ -t "${DOCKER_IMAGE}" \
-f "${DOCKER_FILE}" . -f "${DOCKER_FILE}" .
# Output built borg binary version to assure the binary works. # Output built borg binary version to ensure the binary works.
docker run --rm "${DOCKER_IMAGE}" borg --version docker run --rm "${DOCKER_IMAGE}" borg --version
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# Usage: ./extract.sh <arch> [<version>] [<binary_save_location>] # Usage: ./extract.sh <arch> [<version>] [<binary_save_location>]
BORG_ARCH=${1} BORG_ARCH=${1}
BORG_VERSION=${2:-1.1.10} BORG_VERSION=${2:-1.1.14}
BORG_BINARY=${3:-borg-${BORG_VERSION}-${BORG_ARCH}} BORG_BINARY=${3:-borg-${BORG_VERSION}-${BORG_ARCH}}
DOCKER_IMAGE=borg:${BORG_VERSION}-${BORG_ARCH} DOCKER_IMAGE=borg:${BORG_VERSION}-${BORG_ARCH}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment