From 41afbf3f01d9a68023c937b6430b9f97c355772d Mon Sep 17 00:00:00 2001 From: Abraham Martin <amc203@cam.ac.uk> Date: Thu, 20 Dec 2018 12:47:53 +0100 Subject: [PATCH] Add dockerisation to execute tox inside a container Use themattrix/tox-base docker image. This image contains all versions of python, whuch makes matrix testing very easy. --- Dockerfile | 3 +++ docker-compose.yml | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c7c4f6f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,3 @@ +FROM themattrix/tox-base +ADD . . +RUN tox diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..78bece8 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,21 @@ +# docker-compose file for local development and testing with container image. +# +# Extends compose/base.yml so launch services via: +# +# docker-compose -f compose/base.yml -f compose/tox.yml run --rm tox <...> +version: '3.2' +services: + tox: + build: + context: . + dockerfile: Dockerfile + environment: + - TOXINI_WORK_DIR=/tmp/tox-data/work + - TOXINI_ARTEFACT_DIR=/tmp/tox-data/artefacts + volumes: + - tox-data:/tmp/tox-data + +volumes: + # A persistent volume for tox to store its stuff. This allows caching of + # virtualenvs between runs. + tox-data: -- GitLab