mirror of
https://github.com/yeasy/docker_practice.git
synced 2026-08-10 08:27:25 +00:00
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.
This commit is contained in:
@@ -42,7 +42,7 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
```docker
|
```docker
|
||||||
FROM python:3.12-alpine
|
FROM python:3.12-alpine
|
||||||
ADD . /code
|
COPY . /code
|
||||||
WORKDIR /code
|
WORKDIR /code
|
||||||
RUN pip install redis flask
|
RUN pip install redis flask
|
||||||
CMD ["python", "app.py"]
|
CMD ["python", "app.py"]
|
||||||
|
|||||||
Reference in New Issue
Block a user