Skip to content

Commit c24e3a1

Browse files
jbleduigoutianon
authored andcommitted
Update Golang documentation to use latest stable version (1.17)
1 parent f619ed4 commit c24e3a1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

golang/content.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Go (a.k.a., Golang) is a programming language first developed at Google. It is a
1515
The most straightforward way to use this image is to use a Go container as both the build and runtime environment. In your `Dockerfile`, writing something along the lines of the following will compile and run your project:
1616

1717
```dockerfile
18-
FROM %%IMAGE%%:1.16
18+
FROM %%IMAGE%%:1.17
1919

2020
WORKDIR /go/src/app
2121
COPY . .
@@ -38,27 +38,27 @@ $ docker run -it --rm --name my-running-app my-golang-app
3838
There may be occasions where it is not appropriate to run your app inside a container. To compile, but not run your app inside the Docker instance, you can write something like:
3939

4040
```console
41-
$ docker run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp %%IMAGE%%:1.16 go build -v
41+
$ docker run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp %%IMAGE%%:1.17 go build -v
4242
```
4343

4444
This will add your current directory as a volume to the container, set the working directory to the volume, and run the command `go build` which will tell go to compile the project in the working directory and output the executable to `myapp`. Alternatively, if you have a `Makefile`, you can run the `make` command inside your container.
4545

4646
```console
47-
$ docker run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp %%IMAGE%%:1.16 make
47+
$ docker run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp %%IMAGE%%:1.17 make
4848
```
4949

5050
## Cross-compile your app inside the Docker container
5151

5252
If you need to compile your application for a platform other than `linux/amd64` (such as `windows/386`):
5353

5454
```console
55-
$ docker run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp -e GOOS=windows -e GOARCH=386 %%IMAGE%%:1.16 go build -v
55+
$ docker run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp -e GOOS=windows -e GOARCH=386 %%IMAGE%%:1.17 go build -v
5656
```
5757

5858
Alternatively, you can build for multiple platforms at once:
5959

6060
```console
61-
$ docker run --rm -it -v "$PWD":/usr/src/myapp -w /usr/src/myapp %%IMAGE%%:1.16 bash
61+
$ docker run --rm -it -v "$PWD":/usr/src/myapp -w /usr/src/myapp %%IMAGE%%:1.17 bash
6262
$ for GOOS in darwin linux; do
6363
> for GOARCH in 386 amd64; do
6464
> export GOOS GOARCH

0 commit comments

Comments
 (0)