From 8434b65fcb17c5d1e1949982cf212b1dd2b33bdd Mon Sep 17 00:00:00 2001 From: Sida Chen Date: Tue, 12 Feb 2019 12:50:35 -0500 Subject: [PATCH] Fix python license checking and uninstall docutils on build --- Dockerfile | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5254962ed..73ca68f1b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -77,12 +77,22 @@ RUN curl -fsSL -o /usr/local/bin/prometheus-aggregator https://github.com/coreos && chmod +x /usr/local/bin/prometheus-aggregator # Install python dependencies +# docutils is a setup dependency of botocore required by s3transfer. It's under +# GPLv3, and so should be removed. COPY requirements.txt requirements-tests.txt ./ RUN virtualenv --distribute venv \ && venv/bin/pip install -r requirements.txt \ && venv/bin/pip install -r requirements-tests.txt \ + && (venv/bin/pip uninstall -y docutils || echo "docutils is not installed") \ && venv/bin/pip freeze +# Check python dependencies for the GPL +# Due to the following bug, pip results must be piped to a file before grepping: +# https://github.com/pypa/pip/pull/3304 +RUN venv/bin/pip freeze | grep -v "^-e" | awk -F'==' '{print $1}' | xargs venv/bin/pip --disable-pip-version-check show > pipinfo.txt && \ + test -z "$(cat pipinfo.txt | grep GPL | grep -v LGPL)" && \ + rm pipinfo.txt + # Install front-end dependencies COPY static/ package.json tsconfig.json webpack.config.js tslint.json yarn.lock ./ RUN yarn install --ignore-engines @@ -99,12 +109,7 @@ RUN adduser memcached --disabled-login --system WORKDIR $QUAYDIR -# Check python dependencies for the GPL -# Due to the following bug, pip results must be piped to a file before grepping: -# https://github.com/pypa/pip/pull/3304 -RUN cat requirements.txt | grep -v "^-e" | awk -F'==' '{print $1}' | xargs venv/bin/pip --disable-pip-version-check show > pipinfo.txt && \ - test -z "$(cat pipinfo.txt | grep GPL | grep -v LGPL)" && \ - rm pipinfo.txt + # JS compile COPY bill-of-materials.json bill-of-materials.json