chore: update content and add generated PDF

This commit is contained in:
Baohua Yang
2026-03-27 08:43:47 -07:00
parent 60df65e65b
commit f2f6858745
10 changed files with 24 additions and 24 deletions

View File

@@ -23,7 +23,7 @@
```dockerfile
## Build stage
FROM golang:1.23 AS builder
FROM golang:1.26 AS builder
WORKDIR /app
COPY . .
RUN go build -o main .
@@ -48,7 +48,7 @@ stages:
unit_test:
stage: test
image: golang:1.23
image: golang:1.26
script:
- go test ./...

View File

@@ -17,7 +17,7 @@ VS Code 的 [Dev Containers](https://code.visualstudio.com/docs/devcontainers/co
```json
{
"name": "docker-practice-dev",
"image": "golang:1.22",
"image": "golang:1.26",
"workspaceFolder": "/work",
"workspaceMount": "source=${localWorkspaceFolder},target=/work,type=bind",
"customizations": {

View File

@@ -48,7 +48,7 @@ func main() {
```dockerfile
# Stage 1: 构建阶段
FROM golang:1.20-alpine AS builder
FROM golang:1.26-alpine AS builder
WORKDIR /build
@@ -106,7 +106,7 @@ docker exec go-demo ls -la /
# 只包含 /app 和系统必要文件
# 镜像大小通常 < 10MB相比 golang:1.20-alpine 的 ~1GB
# 镜像大小通常 < 10MB相比 golang:1.26-alpine 的 ~1GB
docker history go-app:latest
```
**go.mod go.sum 示例**
@@ -114,7 +114,7 @@ docker history go-app:latest
```text
module github.com/example/go-app
go 1.20
go 1.26
require (
// 如果需要依赖
@@ -154,7 +154,7 @@ func main() {
**优化的 Dockerfile**
```dockerfile
FROM golang:1.20-alpine AS builder
FROM golang:1.26-alpine AS builder
WORKDIR /src
@@ -746,7 +746,7 @@ Dev Containers 让整个开发环境容器化,提升团队一致性。
```json
{
"name": "Python Dev Environment",
"image": "mcr.microsoft.com/devcontainers/python:3.11",
"image": "mcr.microsoft.com/devcontainers/python:3.14",
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
@@ -802,7 +802,7 @@ Dev Containers 让整个开发环境容器化,提升团队一致性。
**.devcontainer/Dockerfile**
```dockerfile
FROM mcr.microsoft.com/devcontainers/python:3.11
FROM mcr.microsoft.com/devcontainers/python:3.14
# 安装额外工具
RUN apt-get update && apt-get install -y \