You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/guides/golang/build-images.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -107,7 +107,7 @@ Choosing DHI offers the advantage of a production-ready image that is lightweigh
107
107
{{< tab name="Using Docker Hardened Images" >}}
108
108
Docker Hardened Images (DHIs) are available for Go on [Docker Hub](https://hub.docker.com/hardened-images/catalog/dhi/golang). Unlike using the Docker Official Image, you must first mirror the Go image into your organization and then use it as your base image. Follow the instructions in the [DHI quickstart](/dhi/get-started/) to create a mirrored repository for Go.
109
109
110
-
Mirrored repositories must start with `dhi-`, for example: `FROM <your-namespace>/dhi-golang:<tag>`. In the following Dockerfile, the `FROM` instruction uses `<your-namespace>/dhi-golang:1.19` as the base image.
110
+
Mirrored repositories must start with `dhi-`, for example: `FROM <your-namespace>/dhi-golang:<tag>`. In the following Dockerfile, the `FROM` instruction uses `<your-namespace>/dhi-golang:1.25` as the base image.
111
111
112
112
Begin your `Dockerfile` with the (optional) parser directive line that instructs BuildKit to
113
113
interpret your file according to the grammar rules for the specified version of the syntax.
@@ -117,7 +117,7 @@ You then tell Docker what base image you would like to use for your application:
117
117
```dockerfile
118
118
# syntax=docker/dockerfile:1
119
119
120
-
FROM <your-namespace>/dhi-golang:1.19
120
+
FROM <your-namespace>/dhi-golang:1.25
121
121
```
122
122
123
123
Docker images can be inherited from other images. Therefore, instead of creating
@@ -127,7 +127,7 @@ has all necessary tools and libraries to compile and run a Go application.
127
127
{{< /tab >}}
128
128
{{< tab name="Using the official image" >}}
129
129
130
-
Using the Docker Official Image is straightforward. In the following Dockerfile, you'll notice that the `FROM` instruction uses `golang:1.19` as the base image.
130
+
Using the Docker Official Image is straightforward. In the following Dockerfile, you'll notice that the `FROM` instruction uses `golang:1.25` as the base image.
131
131
132
132
This is the official image for Go. This image is [available on the Docker Hub](https://hub.docker.com/_/golang).
133
133
@@ -139,7 +139,7 @@ You then tell Docker what base image you would like to use for your application:
139
139
```dockerfile
140
140
# syntax=docker/dockerfile:1
141
141
142
-
FROM golang:1.19
142
+
FROM golang:1.25
143
143
```
144
144
145
145
Docker images can be inherited from other images. Therefore, instead of creating
@@ -206,7 +206,7 @@ directory inside the image.
206
206
RUN go mod download
207
207
```
208
208
209
-
At this point, you have a Go toolchain version 1.19.x and all your Go
209
+
At this point, you have a Go toolchain version 1.25.x and all your Go
210
210
dependencies installed inside the image.
211
211
212
212
The next thing you need to do is to copy your source code into the image. You’ll
@@ -250,7 +250,7 @@ Here's the complete `Dockerfile`:
250
250
```dockerfile
251
251
# syntax=docker/dockerfile:1
252
252
253
-
FROM <your-namespace>/dhi-golang:1.19
253
+
FROM <your-namespace>/dhi-golang:1.25
254
254
255
255
# Set destination for COPY
256
256
WORKDIR /app
@@ -283,7 +283,7 @@ CMD ["/docker-gs-ping"]
283
283
```dockerfile
284
284
# syntax=docker/dockerfile:1
285
285
286
-
FROM golang:1.19
286
+
FROM golang:1.25
287
287
288
288
# Set destination for COPY
289
289
WORKDIR /app
@@ -326,7 +326,7 @@ that you may have used:
326
326
# syntax=docker/dockerfile:1
327
327
# A sample microservice in Go packaged into a container image.
328
328
329
-
FROM golang:1.19
329
+
FROM golang:1.25
330
330
331
331
# ...
332
332
```
@@ -361,8 +361,8 @@ The following is just an example of what these messages may look like.
0 commit comments