From d74d074ff3396f7186816c3313c383e7f4937fce Mon Sep 17 00:00:00 2001 From: Hau Nguyen Date: Wed, 8 Feb 2023 15:29:08 +0700 Subject: [PATCH] feat: go 1.20 in blog --- bun.lockb | Bin 1183 -> 1183 bytes docs/2022-06-08-dockerfile-go.html | 12 ++++++------ posts/2022-06-08-dockerfile-go.md | 12 ++++++------ 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/bun.lockb b/bun.lockb index 6c4b4c7214c173ddb3851cee15b1cdace935bf3d..db2ce1be0705b9707b6112a8f6e6043355902b11 100755 GIT binary patch delta 80 zcmbQwIiGXFLRJPw28REW85yP2{@+ex0dn8~ozDc8+4zi`aWX5T@Mab!J4QB$;>{k+ G;fw%*rVWb# delta 100 zcmbQwIiGXFLf0d9N7%oxGE{^#u`x0*Fz})AfkJQIvoJ77Kxvr#fq7@MLF$

So I decide to have a baseline Dockerfile like this:

-
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
 
@@ -105,15 +105,15 @@
       Debian version.
     

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

-
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. 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 b8fe99e..378e9ee 100644 --- a/posts/2022-06-08-dockerfile-go.md +++ b/posts/2022-06-08-dockerfile-go.md @@ -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.