Skip to content

Commit

Permalink
Added --no-cache-dir option to all Python pip commands in Dockerfil…
Browse files Browse the repository at this point in the history
…es (docker#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 <andymadge@gmail.com>
  • Loading branch information
andymadge authored Mar 22, 2021
1 parent a2cf9cc commit a42a853
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion django/app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
2 changes: 1 addition & 1 deletion flask/app/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
2 changes: 1 addition & 1 deletion nginx-flask-mongo/flask/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
2 changes: 1 addition & 1 deletion nginx-flask-mysql/backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit a42a853

Please sign in to comment.