...
 
Commits (2)
# Base image to build the binaries from, based on BorgBackup version 1.1.0
# Base image to build the binaries from, based on BorgBackup version 1.1.10
ARG BORG_ARCH
FROM balenalib/${BORG_ARCH}-python:3.5-jessie-run
......@@ -20,13 +20,14 @@ RUN set -ex; \
zlib1g-dev liblz4-dev; \
rm -rf /var/lib/apt/lists/*;
# fetch borg source code for version 1.1.0 and update pip
# fetch borg source code for version 1.1.10 and update pip
RUN set -ex; \
git clone -b 1.1.0 https://github.com/borgbackup/borg.git .; \
git clone -b 1.1.10 https://github.com/borgbackup/borg.git .; \
pip install --upgrade pip;
# install all requirements
RUN set -ex; \
pip install -r requirements.d/development.txt; \
pip install -r requirements.d/fuse.txt; \
pip install -e .[fuse]; \
pip install pyinstaller;
ARG BORG_ARCH
FROM noplanman/borg-binary-builder:base-1.1.0-${BORG_ARCH}
FROM noplanman/borg-binary-builder:base-1.1.10-${BORG_ARCH}
ARG BORG_ARCH
ARG BORG_VERSION=1.1.10
......
......@@ -12,9 +12,11 @@ See the [list of available architectures] ([on GitHub][available-architectures-g
*Examples:*
- Build version `1.1.10` for `aarch64`
`./build.sh aarch64 1.1.10`
- Build version `1.1.5` for Raspberry Pi 3
`./build.sh raspberrypi3 1.1.5`
### Extract borg binary
......@@ -25,22 +27,26 @@ See the [list of available architectures] ([on GitHub][available-architectures-g
*Examples:*
- Extract borg `1.1.10` binary for `aarch64` to `borg-aarch64` in current folder
`./extract.sh aarch64 1.1.10 borg-aarch64`
- Extract borg `1.1.5` binary for Raspberry Pi 3 to `/homes/lemoi/borg`
`./extract.sh raspberrypi3 1.1.5 /homes/lemoi/borg`
### Build base image
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.
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)*.
Adding a new architecture to the base image list and pushing it to docker hub:
`./build-base.sh <arch>`
*Examples:*
- Build base image for `aarch64`
- Build base image for `aarch64`:
`./build-base.sh aarch64`
## How this works
......@@ -56,6 +62,7 @@ Then, the docker image is built for the requested architecture.
This is basically done by following the flow of setting up a [BorgBackup development environment] and [creating the standalone binary]. (For more info on this, just have a look at the `Dockerfile`)
When using the base images created by `build-base.sh`, instead of using the normal `Dockerfile`, you can set the `BBB_HOT` environment variable to any value, which makes the build script use `Dockerfile.hot`.
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.
......
......@@ -8,6 +8,8 @@
# For available architectures see:
# https://www.balena.io/docs/reference/base-images/base-images/#balena-base-images
set -ex
BORG_ARCH=${1}
if [ -z "${BORG_ARCH}" ]; then
......@@ -16,7 +18,7 @@ if [ -z "${BORG_ARCH}" ]; then
exit 1;
fi
DOCKER_IMAGE=noplanman/borg-binary-builder:base-1.1.0-${BORG_ARCH}
DOCKER_IMAGE=noplanman/borg-binary-builder:base-1.1.10-${BORG_ARCH}
echo "Building ${DOCKER_IMAGE}"
......@@ -28,5 +30,8 @@ docker build \
-t "${DOCKER_IMAGE}" \
-f Dockerfile.base .
# Output built borg binary version to assure the binary works.
docker run --rm "${DOCKER_IMAGE}" borg --version
echo "Pushing to docker hub"
docker push "${DOCKER_IMAGE}"
......@@ -5,6 +5,8 @@
# For available architectures see:
# https://www.balena.io/docs/reference/base-images/base-images/#balena-base-images
set -ex
BORG_ARCH=${1}
BORG_VERSION=${2:-1.1.10}
......@@ -34,3 +36,6 @@ docker build \
--build-arg "BORG_VERSION=${BORG_VERSION}" \
-t "${DOCKER_IMAGE}" \
-f "${DOCKER_FILE}" .
# Output built borg binary version to assure the binary works.
docker run --rm "${DOCKER_IMAGE}" borg --version