heralding
heralding copied to clipboard
fixed Docker build
Summary of my changes:
- Updated Dockerfile to newer base image with Python 3.9 (due to older base image issues with
apt
) - Pinned
requirements.txt
dependencies for stability - Reorganized
Dockerfile
Updated Dockerfile base image to Python 3.9
This updates the Dockerfile to a more recent Python base image. Apparently, asyncio
in Python 3.10 doesn't like the loop
argument, which results in the issue described here: https://github.com/johnnykv/heralding/issues/154
The current Dockerfile has been unable to build properly for the last 9 months due to apt
errors:
#12 CANCELED
------
> [linux/arm64 base 3/4] RUN apt-get update && apt-get install -y libpq-dev gcc && pip install --user --no-cache-dir -r requirements.txt:
1.375 404 Not Found
1.410 Ign:6 http://deb.debian.org/debian stretch/main all Packages
1.622 W: The repository 'http://deb.debian.org/debian stretch Release' does not have a Release file.
1.623 W: The repository 'http://deb.debian.org/debian stretch-updates Release' does not have a Release file.
1.623 W: The repository 'http://security.debian.org/debian-security stretch/updates Release' does not have a Release file.
1.623 E: Failed to fetch http://deb.debian.org/debian/dists/stretch/main/binary-arm64/Packages 404 Not Found
1.623 E: Failed to fetch http://deb.debian.org/debian/dists/stretch-updates/main/binary-arm64/Packages 404 Not Found
1.623 E: Failed to fetch http://security.debian.org/debian-security/dists/stretch/updates/main/binary-arm64/Packages 404 Not Found
1.623 E: Some index files failed to download. They have been ignored, or old ones used instead.
This pull request fixes https://github.com/johnnykv/heralding/issues/153
Pinned all dependencies in requirements.txt
to their current version for greater stability moving forward
Not much to explain here.
I'd recommend setting up something like Renovate to scan requirements.txt
for vulnerabilities and automating updates in the future. :smile:
Reorganized Dockerfile for faster builds
I reorganized the Docker file so dependencies are installed before copying the entire repo to the image. This results in dependencies being in one layer of the Dockerfile and allows Docker builds to be much quicker if changing anything that's not a dependency (since installing the dependencies is the longest step in this Dockerfile). Meaning changes to a file like heralding/honeypot.py
won't take Docker five minutes to build the container because it can use the cache for installing dependencies.