From acd8971913937f90cd50e4ab189c689e309d326e Mon Sep 17 00:00:00 2001
From: Hau Nguyen
So I decide to have a baseline Dockerfile like this:
FROM golang:1.21-bookworm as builder
+ FROM golang:1.22.0-bookworm as builder
-RUN go install golang.org/dl/go1.21@latest \
- && go1.21 download
+RUN go install golang.org/dl/go1.22.0@latest \
+ && go1.22.0 download
WORKDIR /build
@@ -91,15 +91,15 @@
Debian version.
- FROM golang:1.21-bookworm as builder
+ FROM golang:1.22.0-bookworm as builder
This is Go image I use as a build stage. This can be official Go image or
custom image is required in some companies.
- RUN go install golang.org/dl/go1.21@latest \
- && go1.21 download
+ RUN go install golang.org/dl/go1.22.0@latest \
+ && go1.22.0 download
This is optional. In my case, my company is slow to update Go image so I
diff --git a/posts/2022-06-08-dockerfile-go.md b/posts/2022-06-08-dockerfile-go.md
index b78b290..5d4fdb4 100644
--- a/posts/2022-06-08-dockerfile-go.md
+++ b/posts/2022-06-08-dockerfile-go.md
@@ -6,10 +6,10 @@ Each time I start a new Go project, I repeat many steps. Like set up
So I decide to have a baseline Dockerfile like this:
```Dockerfile
-FROM golang:1.21-bookworm as builder
+FROM golang:1.22.0-bookworm as builder
-RUN go install golang.org/dl/go1.21@latest \
- && go1.21 download
+RUN go install golang.org/dl/go1.22.0@latest \
+ && go1.22.0 download
WORKDIR /build
@@ -43,15 +43,15 @@ Also, remember to match Distroless Debian version with Go official image Debian
version.
```Dockerfile
-FROM golang:1.21-bookworm as builder
+FROM golang:1.22.0-bookworm as builder
```
This is Go image I use as a build stage. This can be official Go image or custom
image is required in some companies.
```Dockerfile
-RUN go install golang.org/dl/go1.21@latest \
- && go1.21 download
+RUN go install golang.org/dl/go1.22.0@latest \
+ && go1.22.0 download
```
This is optional. In my case, my company is slow to update Go image so I use