From 77d320eeee8e3e3c26282e12aaf9d2ec4af856f8 Mon Sep 17 00:00:00 2001 From: ViViDboarder Date: Wed, 12 Feb 2020 17:43:36 -0800 Subject: [PATCH] Yay! Switch to eoan and simplify install This also enables functioning multi-arch and s3 tests --- Dockerfile | 34 +++++++++++++------------------- Makefile | 8 ++++---- tests/docker-compose-test-s3.yml | 8 +------- tests/test-compose.sh | 6 ++++++ tests/test-s3.sh | 5 ----- tests/test.sh | 3 +++ 6 files changed, 28 insertions(+), 36 deletions(-) create mode 100755 tests/test-compose.sh delete mode 100755 tests/test-s3.sh diff --git a/Dockerfile b/Dockerfile index b97df1e..77a84a3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 " # 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/* diff --git a/Makefile b/Makefile index 8d948c4..412398c 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/tests/docker-compose-test-s3.yml b/tests/docker-compose-test-s3.yml index 9af8f03..be4c808 100644 --- a/tests/docker-compose-test-s3.yml +++ b/tests/docker-compose-test-s3.yml @@ -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 diff --git a/tests/test-compose.sh b/tests/test-compose.sh new file mode 100755 index 0000000..784f39b --- /dev/null +++ b/tests/test-compose.sh @@ -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 diff --git a/tests/test-s3.sh b/tests/test-s3.sh deleted file mode 100755 index 957da2d..0000000 --- a/tests/test-s3.sh +++ /dev/null @@ -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 diff --git a/tests/test.sh b/tests/test.sh index bc27db5..f302cf9 100755 --- a/tests/test.sh +++ b/tests/test.sh @@ -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"