From a42a8531abb3f242a07c8464c65831e38a8968ac Mon Sep 17 00:00:00 2001 From: Andy Madge Date: Mon, 22 Mar 2021 09:01:41 +0000 Subject: [PATCH] Added `--no-cache-dir` option to all Python pip commands in Dockerfiles (#113) The cache gives no benefit to a Docker image but it does add size, hence it's best left out. Signed-off-by: Andy Madge --- django/app/Dockerfile | 2 +- flask/app/Dockerfile | 2 +- nginx-flask-mongo/flask/Dockerfile | 2 +- nginx-flask-mysql/backend/Dockerfile | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/django/app/Dockerfile b/django/app/Dockerfile index 2c645b1..a86ae9c 100644 --- a/django/app/Dockerfile +++ b/django/app/Dockerfile @@ -2,7 +2,7 @@ FROM python:3.7-alpine EXPOSE 8000 WORKDIR /app COPY requirements.txt /app -RUN pip3 install -r requirements.txt +RUN pip3 install -r requirements.txt --no-cache-dir COPY . /app ENTRYPOINT ["python3"] CMD ["manage.py", "runserver", "0.0.0.0:8000"] diff --git a/flask/app/Dockerfile b/flask/app/Dockerfile index 1ba409a..cf861e9 100644 --- a/flask/app/Dockerfile +++ b/flask/app/Dockerfile @@ -1,7 +1,7 @@ FROM python:3.7-alpine WORKDIR /app COPY requirements.txt /app -RUN pip3 install -r requirements.txt +RUN pip3 install -r requirements.txt --no-cache-dir COPY . /app ENTRYPOINT ["python3"] CMD ["app.py"] diff --git a/nginx-flask-mongo/flask/Dockerfile b/nginx-flask-mongo/flask/Dockerfile index 220f79a..2f4e2ef 100755 --- a/nginx-flask-mongo/flask/Dockerfile +++ b/nginx-flask-mongo/flask/Dockerfile @@ -2,6 +2,6 @@ FROM python:3.7 WORKDIR /src COPY . . -RUN pip install -r requirements.txt +RUN pip install -r requirements.txt --no-cache-dir CMD ["./server.py"] diff --git a/nginx-flask-mysql/backend/Dockerfile b/nginx-flask-mysql/backend/Dockerfile index 73848ed..bc71f1d 100755 --- a/nginx-flask-mysql/backend/Dockerfile +++ b/nginx-flask-mysql/backend/Dockerfile @@ -1,7 +1,7 @@ FROM python:3.8-alpine WORKDIR /code COPY requirements.txt /code/ -RUN pip install -r requirements.txt +RUN pip install -r requirements.txt --no-cache-dir COPY . /code/ ENV FLASK_APP hello.py CMD flask run --host=0.0.0.0