Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/tools/dockerfile-memo/dockerfile.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ COPY --from=builder /app/dist /usr/share/nginx/html
You can name each stage using `AS <name>` and reference it later with `--from=<name>`.

```Dockerfile
FROM golang:1.21 AS build
FROM golang:1.26@sha256:ae5a2316d12f3e78fd99177dad452e6ad4f240af2d71d57b480c3477f250fec6 AS build
WORKDIR /src
COPY . .
RUN go build -o myapp
Expand Down
2 changes: 1 addition & 1 deletion src/tools/dockerfile-memo/dockerfile.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ COPY --from=builder /app/dist /usr/share/nginx/html
你可以使用 `AS <name>` 为每个阶段命名,并在之后通过 `--from=<name>` 引用它。

```Dockerfile
FROM golang:1.21 AS build
FROM golang:1.26@sha256:ae5a2316d12f3e78fd99177dad452e6ad4f240af2d71d57b480c3477f250fec6 AS build
WORKDIR /src
COPY . .
RUN go build -o myapp
Expand Down
Loading