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