All checks were successful
CI / validate (push) Successful in 20s
Dockerfile.test builds production image with pytest baked in. compose.test.yml mounts source as volume for fast iteration. Usage: podman-compose -f compose.test.yml run --rm test
30 lines
1.0 KiB
Docker
30 lines
1.0 KiB
Docker
FROM python:2.7-slim
|
|
|
|
WORKDIR /app
|
|
|
|
RUN sed -i 's/deb.debian.org/archive.debian.org/g' /etc/apt/sources.list && \
|
|
sed -i 's/security.debian.org/archive.debian.org/g' /etc/apt/sources.list && \
|
|
sed -i '/buster-updates/d' /etc/apt/sources.list && \
|
|
echo 'deb http://archive.debian.org/debian-security buster/updates main' >> /etc/apt/sources.list && \
|
|
apt-get update && \
|
|
apt-get upgrade -y && \
|
|
apt-get install -y --no-install-recommends gcc libc-dev && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN pip install --upgrade "pip<21" "setuptools<45" "wheel<0.38"
|
|
|
|
COPY requirements.txt .
|
|
RUN pip install -r requirements.txt || true
|
|
RUN pip install pytest
|
|
|
|
RUN mkdir -p /app/data && \
|
|
python -c "import pyasn" 2>/dev/null && \
|
|
pyasn_util_download.py --latest && \
|
|
pyasn_util_convert.py --single rib.*.bz2 /app/data/ipasn.dat && \
|
|
rm -f rib.*.bz2 || \
|
|
echo "pyasn database setup skipped"
|
|
|
|
RUN apt-get purge -y gcc libc-dev && apt-get autoremove -y || true
|
|
|
|
CMD ["python", "-m", "pytest", "tests/", "-v", "--tb=short"]
|