mirror of
https://github.com/yeasy/docker_practice.git
synced 2026-03-23 18:25:25 +00:00
Remove blank lines after code block markers
This commit is contained in:
@@ -21,7 +21,6 @@
|
||||
使用 Docker 多阶段构建可以有效减小镜像体积。
|
||||
|
||||
```dockerfile
|
||||
|
||||
## Build stage
|
||||
|
||||
FROM golang:1.23 AS builder
|
||||
@@ -36,7 +35,6 @@ WORKDIR /app
|
||||
COPY --from=builder /app/main .
|
||||
CMD ["./main"]
|
||||
```
|
||||
|
||||
#### 2. GitLab CI 配置
|
||||
|
||||
GitLab CI(`.gitlab-ci.yml`)配置如下:
|
||||
@@ -76,7 +74,6 @@ deploy_staging:
|
||||
only:
|
||||
- develop
|
||||
```
|
||||
|
||||
### 21.1.3 最佳实践
|
||||
|
||||
1. **不可变基础设施**:一旦镜像构建完成,在各个环境(Dev、Staging、Prod)中都应该使用同一个镜像 tag(通常是 commit hash),而不是重新构建。
|
||||
|
||||
Reference in New Issue
Block a user