From 6a55219310194c9fed2cbbb10fd0a857a79fef1a Mon Sep 17 00:00:00 2001 From: yeasy Date: Sat, 23 May 2026 21:27:01 -0700 Subject: [PATCH] fix(11.3): use COPY (not ADD) in Flask/Redis intro Dockerfile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit §7.3 of this book explicitly recommends COPY over ADD for simple file copies ("在大多数情况下,你应该使用 COPY,而不是 ADD"). The intro Compose example showed ADD without needing tar extraction or URL download, contradicting the canonical guidance. Switched to COPY so the first Dockerfile readers see matches the rule the book teaches a few chapters later. --- 11_compose/11.3_usage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/11_compose/11.3_usage.md b/11_compose/11.3_usage.md index 9ca177f..7abedca 100644 --- a/11_compose/11.3_usage.md +++ b/11_compose/11.3_usage.md @@ -42,7 +42,7 @@ if __name__ == "__main__": ```docker FROM python:3.12-alpine -ADD . /code +COPY . /code WORKDIR /code RUN pip install redis flask CMD ["python", "app.py"]