feat: update go version to 1.22.0

main
sudo pacman -Syu 2024-03-01 16:54:09 +07:00
parent 061f4bcf4a
commit acd8971913
2 changed files with 12 additions and 12 deletions

View File

@ -44,10 +44,10 @@
</p>
<p>So I decide to have a baseline Dockerfile like this:</p>
<div class="highlight highlight-source-dockerfile">
<pre><span class="pl-k">FROM</span> golang:1.21-bookworm as builder
<pre><span class="pl-k">FROM</span> golang:1.22.0-bookworm as builder
<span class="pl-k">RUN</span> go install golang.org/dl/go1.21@latest \
&amp;&amp; go1.21 download
<span class="pl-k">RUN</span> go install golang.org/dl/go1.22.0@latest \
&amp;&amp; go1.22.0 download
<span class="pl-k">WORKDIR</span> /build
@ -91,15 +91,15 @@
Debian version.
</p>
<div class="highlight highlight-source-dockerfile">
<pre><span class="pl-k">FROM</span> golang:1.21-bookworm as builder</pre>
<pre><span class="pl-k">FROM</span> golang:1.22.0-bookworm as builder</pre>
</div>
<p>
This is Go image I use as a build stage. This can be official Go image or
custom image is required in some companies.
</p>
<div class="highlight highlight-source-dockerfile">
<pre><span class="pl-k">RUN</span> go install golang.org/dl/go1.21@latest \
&amp;&amp; go1.21 download</pre>
<pre><span class="pl-k">RUN</span> go install golang.org/dl/go1.22.0@latest \
&amp;&amp; go1.22.0 download</pre>
</div>
<p>
This is optional. In my case, my company is slow to update Go image so I

View File

@ -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