Yay! Switch to eoan and simplify install

This also enables functioning multi-arch and s3 tests
This commit is contained in:
ViViDboarder 2020-02-12 17:43:36 -08:00
parent 47a431abf6
commit 77d320eeee
6 changed files with 28 additions and 36 deletions

View File

@ -1,34 +1,28 @@
ARG REPO=library
FROM ${REPO}/ubuntu:xenial
FROM multiarch/qemu-user-static:4.1.0-1 AS qemu
FROM ${REPO}/ubuntu:eoan
LABEL maintainer="ViViDboarder <vividboarder@gmail.com>"
# Allow building/running non-amd64 images from amd64
COPY --from=multiarch/qemu-user-static:4.1.0-1 /usr/bin/qemu-* /usr/bin/
COPY --from=qemu /usr/bin/qemu-* /usr/bin/
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
software-properties-common python-software-properties \
&& add-apt-repository ppa:duplicity-team/ppa \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
cron \
duplicity \
# duplicity recommended
python3-oauthlib \
python3-paramiko \
python3-pexpect \
python3-urllib3 \
rsync \
# duplicity suggests
lftp \
ncftp \
openssh-client \
python-cloudfiles \
python-gdata \
python-oauthlib \
python-paramiko \
python-pexpect \
python-pip \
python-setuptools \
python-swiftclient \
python-urllib3 \
rsync \
tahoe-lafs \
&& pip install -U --no-cache-dir boto==2.49.0 b2==1.4.2 \
&& apt-get autoremove -y python-pip python-setuptools \
par2 \
python3-boto \
python3-swiftclient \
# tahoe-lafs \ # This depends on Python 2 and is left out for now
&& apt-get clean \
&& rm -rf /var/apt/lists/*

View File

@ -35,22 +35,22 @@ test-all: test-amd64 test-arm
.PHONY: test-s3-amd64
test-s3-amd64: build-amd64
cd tests && ./test-s3.sh $(DOCKER_TAG):amd64
cd tests && ./test-compose.sh s3 $(DOCKER_TAG):amd64
.PHONY: test-s3-arm
test-s3-arm: build-arm
cd tests && ./test-s3.sh $(DOCKER_TAG):arm
cd tests && ./test-compose.sh s3 $(DOCKER_TAG):arm
.PHONY: test-s3-all
test-s3-all: test-s3-amd64 test-s3-arm
.PHONY: shell-amd64
shell-amd64: build-amd64
docker run --rm -it $(DOCKER_TAG):ubuntu bash
docker run --rm -it $(DOCKER_TAG):amd64 bash
.PHONY: shell-arm
shell-arm: build-arm
docker run --rm -it $(DOCKER_TAG):raspbian bash
docker run --rm -it $(DOCKER_TAG):arm bash
.PHONY: shell
shell: shell-amd64

View File

@ -3,11 +3,6 @@ version: '2'
services:
duplicity:
image: "$DOCKER_IMAGE"
# build:
# context: ..
# dockerfile: Dockerfile
# args:
# REPO: "${BUILD_ARG_REPO}"
entrypoint: "bash"
command: ["/test.sh"]
hostname: itest
@ -19,10 +14,9 @@ services:
AWS_DEFAULT_REGION: us-east-1
AWS_ACCESS_KEY_ID: SUPER_SECRET_ACCESS_KEY
AWS_SECRET_ACCESS_KEY: SUPER_SECRET_SECRET_KEY
SLEEP: 2
volumes:
- "./test.sh:/test.sh"
links:
- minio
minio:
image: minio/minio
command: server /data

6
tests/test-compose.sh Executable file
View File

@ -0,0 +1,6 @@
#! /bin/bash
export COMPOSE_FILE="docker-compose-test-$1.yml"
export DOCKER_IMAGE="$2"
docker-compose -f "$COMPOSE_FILE" up \
--build --abort-on-container-exit --force-recreate

View File

@ -1,5 +0,0 @@
#! /bin/bash
export DOCKER_IMAGE="$1"
docker-compose -f docker-compose-test-s3.yml up \
--build --abort-on-container-exit --force-recreate

View File

@ -12,6 +12,9 @@ if [ "$IN_CONTAINER" != "true" ] ; then
"$image" \
bash -c "/test.sh"
else
# Optionally sleep at beginning for compose tests that may need it
sleep "${SLEEP:-0}"
echo "Performing backup tests"
echo "Verify cron and crontab exist"