From 75a30f14fb471252898bff0e3c5b1e2ddf452943 Mon Sep 17 00:00:00 2001 From: Khanh Ngo Date: Sat, 10 Oct 2020 21:47:58 +0200 Subject: [PATCH] Dockerfile and requirements.txt update - Fix bug in python requests module missing after delete py3-pip from build stage - Downgrade the requirement of bcrypt to >=3.1.7 for older python3 version compatibility --- docker/Dockerfile | 8 +++++--- requirements.txt | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 11d5c9d..9f932b2 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -6,7 +6,6 @@ ARG BUILD_DEPENDENCIES="build-base \ libxml2-dev \ mariadb-connector-c-dev \ openldap-dev \ - py3-pip \ python3-dev \ xmlsec-dev \ yarn" @@ -17,7 +16,11 @@ ENV LC_ALL=en_US.UTF-8 \ FLASK_APP=/build/powerdnsadmin/__init__.py # Get dependencies -RUN apk add --no-cache ${BUILD_DEPENDENCIES} +# py3-pip should not belong to BUILD_DEPENDENCIES. Otherwise, when we remove +# them with "apk del" at the end of build stage, the python requests module +# will be removed as well - (Tested with alpine:3.12 and python 3.8.5). +RUN apk add --no-cache ${BUILD_DEPENDENCIES} && \ + apk add --no-cache py3-pip WORKDIR /build @@ -69,7 +72,6 @@ RUN pip install pip-autoremove && \ pip uninstall -y pip-autoremove && \ apk del ${BUILD_DEPENDENCIES} - # Build image FROM alpine:3.12 diff --git a/requirements.txt b/requirements.txt index 018e03f..0a919fa 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,7 +6,7 @@ Flask-Migrate==2.5.3 SQLAlchemy==1.3.19 mysqlclient==2.0.1 configobj==5.0.6 -bcrypt==3.2.0 +bcrypt>=3.1.7 requests==2.24.0 python-ldap==3.3.1 pyotp==2.4.0