Debian docker image pip error (#2849)

* Use virtualenv to install tox in behave Dockerfile

Upstream change in postgres docker image uses debian restriction on
installing system-wide non-debian python packages. Debian doesn't
provide a tox>=4, so we need to install with pip.

* Exclude all output directories generated using `tox-wrapper.sh`

The `tox-wrapper.sh` script created by `features/Dockerfile` creates
directories like features/output-tox-pg14-docker-behave-etcd-lin-973719674/

* Reduce footprint of tox behave docker image
This commit is contained in:
Matt Baker
2023-09-04 21:24:26 +02:00
committed by GitHub
parent 6b7f914da7
commit d2603402ea
2 changed files with 6 additions and 3 deletions
+1 -1
View File
@@ -33,7 +33,7 @@ nosetests.xml
coverage.xml coverage.xml
htmlcov htmlcov
junit.xml junit.xml
features/output features/output*
dummy dummy
# Translations # Translations
+5 -2
View File
@@ -27,8 +27,8 @@ RUN set -ex \
&& apt-get update \ && apt-get update \
&& apt-get reinstall init-system-helpers \ && apt-get reinstall init-system-helpers \
&& apt-get install -y \ && apt-get install -y \
python3-pip \
python3-dev \ python3-dev \
python3-venv \
rsync \ rsync \
curl \ curl \
gcc \ gcc \
@@ -40,7 +40,9 @@ RUN set -ex \
net-tools \ net-tools \
iputils-ping \ iputils-ping \
&& rm -rf /var/cache/apt \ && rm -rf /var/cache/apt \
&& python3 -m pip install --no-cache-dir tox \ \
&& python3 -m venv /tox \
&& /tox/bin/pip install --no-cache-dir tox>=4 \
\ \
&& mkdir -p "$PGHOME" \ && mkdir -p "$PGHOME" \
&& sed -i "s|/var/lib/postgresql.*|$PGHOME:/bin/bash|" /etc/passwd \ && sed -i "s|/var/lib/postgresql.*|$PGHOME:/bin/bash|" /etc/passwd \
@@ -50,6 +52,7 @@ RUN set -ex \
&& curl -sL "$ETCDURL/etcd-v$ETCDVERSION-linux-$(dpkg --print-architecture).tar.gz" \ && curl -sL "$ETCDURL/etcd-v$ETCDVERSION-linux-$(dpkg --print-architecture).tar.gz" \
| tar xz -C /usr/local/bin --strip=1 --wildcards --no-anchored etcd etcdctl | tar xz -C /usr/local/bin --strip=1 --wildcards --no-anchored etcd etcdctl
ENV PATH="/tox/bin:$PATH"
# This Dockerfile syntax only works with docker buildx and the syntax # This Dockerfile syntax only works with docker buildx and the syntax
# line at the top of this file. # line at the top of this file.