Skip to content

Commit 6a55219

Browse files
committed
fix(11.3): use COPY (not ADD) in Flask/Redis intro Dockerfile
§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.
1 parent 8f4d88e commit 6a55219

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

11_compose/11.3_usage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ if __name__ == "__main__":
4242

4343
```docker
4444
FROM python:3.12-alpine
45-
ADD . /code
45+
COPY . /code
4646
WORKDIR /code
4747
RUN pip install redis flask
4848
CMD ["python", "app.py"]

0 commit comments

Comments
 (0)