-
-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Swarm mode check fails on non-standard Info responses
- Loading branch information
Showing
13 changed files
with
178 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
#syntax=docker/dockerfile:1.2 | ||
|
||
# BUILDPLATFORM is set by buildkit (DOCKER_BUILDKIT=1) | ||
# hadolint ignore=DL3029 | ||
FROM --platform=$BUILDPLATFORM debian:bullseye-20211220-slim AS buildroot-base | ||
|
||
# hadolint ignore=DL3008 | ||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
bc \ | ||
build-essential \ | ||
ca-certificates \ | ||
cmake \ | ||
cpio \ | ||
file \ | ||
git \ | ||
locales \ | ||
python3 \ | ||
rsync \ | ||
unzip \ | ||
wget && \ | ||
apt-get clean && rm -rf /var/lib/apt/lists/* | ||
|
||
# hadolint ignore=DL3059 | ||
RUN sed -i 's/# \(en_US.UTF-8\)/\1/' /etc/locale.gen && \ | ||
/usr/sbin/locale-gen && \ | ||
useradd -ms /bin/bash br-user && \ | ||
chown -R br-user:br-user /home/br-user | ||
|
||
USER br-user | ||
|
||
WORKDIR /home/br-user | ||
|
||
ENV HOME=/home/br-user | ||
|
||
ENV LC_ALL=en_US.UTF-8 | ||
|
||
ARG BR_VERSION=2021.11 | ||
|
||
RUN git clone --depth 1 --branch ${BR_VERSION} https://git.busybox.net/buildroot | ||
|
||
FROM buildroot-base as rootfs | ||
|
||
WORKDIR /home/br-user/buildroot | ||
|
||
# set by buildkit (DOCKER_BUILDKIT=1) | ||
ARG TARGETARCH | ||
ARG TARGETVARIANT | ||
|
||
# musl or glibc (musl is smaller) | ||
ARG ROOTFS_LIBC=musl | ||
|
||
COPY config ./config | ||
|
||
RUN support/kconfig/merge_config.sh -m \ | ||
config/arch/"${TARGETARCH}${TARGETVARIANT}".cfg \ | ||
config/libc/"${ROOTFS_LIBC}".cfg \ | ||
config/*.cfg | ||
|
||
RUN --mount=type=cache,target=/cache,uid=1000,gid=1000,sharing=private \ | ||
make olddefconfig && make source && make | ||
|
||
# hadolint ignore=DL3002 | ||
USER root | ||
|
||
WORKDIR /rootfs | ||
|
||
RUN tar xpf /home/br-user/buildroot/output/images/rootfs.tar -C /rootfs | ||
|
||
FROM scratch | ||
|
||
COPY --from=rootfs rootfs/ / | ||
|
||
ENTRYPOINT [ "/usr/bin/balena-engine-daemon" ] | ||
|
||
CMD [ "-H", "tcp://0.0.0.0:2375" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Dockerfile and content in `config` is taken from | ||
https://github.com/balena-io-experimental/balena-engine-docker which is | ||
distributed under the Apache-2.0 license: | ||
https://github.com/balena-io-experimental/balena-engine-docker/blob/532d24e746240a5d26bcd55112e8cf68dd6b8227/LICENSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
BR2_x86_64=y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
BR2_aarch64=y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
BR2_arm=y | ||
BR2_arm1176jzf_s=y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
BR2_arm=y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
BR2_PACKAGE_TINI=y | ||
BR2_PACKAGE_BALENA_ENGINE=y | ||
BR2_PACKAGE_CA_CERTIFICATES=y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
BR2_TOOLCHAIN_BUILDROOT_CXX=y | ||
BR2_KERNEL_HEADERS_4_19=y | ||
BR2_GCC_ENABLE_LTO=y | ||
|
||
# We don't need init inside a container | ||
BR2_INIT_NONE=y | ||
|
||
# Also unselect busybox | ||
BR2_PACKAGE_BUSYBOX=n | ||
|
||
# We don't need a system shell or ifupdown-scripts | ||
BR2_SYSTEM_BIN_SH_NONE=y | ||
BR2_PACKAGE_IFUPDOWN_SCRIPTS=n | ||
|
||
# Setup cache paths | ||
BR2_DL_DIR="/cache/dl" | ||
|
||
BR2_CCACHE=y | ||
BR2_CCACHE_DIR="/cache/ccache" | ||
BR2_CCACHE_USE_BASEDIR=y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
BR2_TOOLCHAIN_BUILDROOT_GLIBC=y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
BR2_TOOLCHAIN_BUILDROOT_MUSL=y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
version: '3' | ||
|
||
services: | ||
balena: | ||
build: . | ||
privileged: true | ||
|
||
backup: | ||
image: offen/docker-volume-backup:${TEST_VERSION:-canary} | ||
hostname: hostnametoken | ||
restart: always | ||
environment: | ||
BACKUP_CRON_EXPRESSION: 0 0 5 31 2 ? | ||
BACKUP_FILENAME: test.tar.gz | ||
DOCKER_HOST: tcp://balena:2375 | ||
volumes: | ||
- ${LOCAL_DIR:-./local}:/archive | ||
- app_data:/backup/app_data:ro | ||
|
||
offen: | ||
image: offen/offen:latest | ||
labels: | ||
- docker-volume-backup.stop-during-backup=true | ||
volumes: | ||
- app_data:/var/opt/offen | ||
|
||
volumes: | ||
minio_backup_data: | ||
name: minio_backup_data | ||
app_data: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
cd $(dirname $0) | ||
. ../util.sh | ||
current_test=$(basename $(pwd)) | ||
|
||
export LOCAL_DIR=$(mktemp -d) | ||
|
||
docker compose up -d | ||
|
||
sleep 20 | ||
|
||
expect_running_containers "3" | ||
|
||
docker compose exec backup backup | ||
|
||
sleep 5 | ||
|
||
if [ ! -f $LOCAL_DIR/test.tar.gz ]; then | ||
fail "Archive was not created" | ||
fi | ||
pass "Found expected file." | ||
|
||
expect_running_containers "3" |