feat: go 1.20 in blog
parent
cab025ceae
commit
d74d074ff3
|
@ -58,10 +58,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.19-bullseye as builder
|
||||
<pre><span class="pl-k">FROM</span> golang:1.20-bullseye as builder
|
||||
|
||||
<span class="pl-k">RUN</span> go install golang.org/dl/go1.19@latest \
|
||||
&& go1.19 download
|
||||
<span class="pl-k">RUN</span> go install golang.org/dl/go1.20@latest \
|
||||
&& go1.20 download
|
||||
|
||||
<span class="pl-k">WORKDIR</span> /build
|
||||
|
||||
|
@ -105,15 +105,15 @@
|
|||
Debian version.
|
||||
</p>
|
||||
<div class="highlight highlight-source-dockerfile">
|
||||
<pre><span class="pl-k">FROM</span> golang:1.19-bullseye as builder</pre>
|
||||
<pre><span class="pl-k">FROM</span> golang:1.20-bullseye 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.19@latest \
|
||||
&& go1.19 download</pre>
|
||||
<pre><span class="pl-k">RUN</span> go install golang.org/dl/go1.20@latest \
|
||||
&& go1.20 download</pre>
|
||||
</div>
|
||||
<p>
|
||||
This is optional. In my case, my company is slow to update Go image so I
|
||||
|
|
|
@ -6,10 +6,10 @@ Like set up `.gitignore`, CI configs, Dockerfile, ...
|
|||
So I decide to have a baseline Dockerfile like this:
|
||||
|
||||
```Dockerfile
|
||||
FROM golang:1.19-bullseye as builder
|
||||
FROM golang:1.20-bullseye as builder
|
||||
|
||||
RUN go install golang.org/dl/go1.19@latest \
|
||||
&& go1.19 download
|
||||
RUN go install golang.org/dl/go1.20@latest \
|
||||
&& go1.20 download
|
||||
|
||||
WORKDIR /build
|
||||
|
||||
|
@ -39,15 +39,15 @@ So I stick with it for a while.
|
|||
Also, remember to match Distroless Debian version with Go official image Debian version.
|
||||
|
||||
```Dockerfile
|
||||
FROM golang:1.19-bullseye as builder
|
||||
FROM golang:1.20-bullseye 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.19@latest \
|
||||
&& go1.19 download
|
||||
RUN go install golang.org/dl/go1.20@latest \
|
||||
&& go1.20 download
|
||||
```
|
||||
|
||||
This is optional.
|
||||
|
|
Loading…
Reference in New Issue