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: golang/README.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -104,7 +104,7 @@ Go (a.k.a., Golang) is a programming language first developed at Google. It is a
104
104
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 (assuming it uses `go.mod` for dependency management):
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:
131
131
132
132
```console
133
-
$ docker run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp golang:1.21 go build -v
133
+
$ docker run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp golang:1.22 go build -v
134
134
```
135
135
136
136
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.
137
137
138
138
```console
139
-
$ docker run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp golang:1.21 make
139
+
$ docker run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp golang:1.22 make
140
140
```
141
141
142
142
## Cross-compile your app inside the Docker container
143
143
144
144
If you need to compile your application for a platform other than `linux/amd64` (such as `windows/386`):
145
145
146
146
```console
147
-
$ docker run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp -e GOOS=windows -e GOARCH=386 golang:1.21 go build -v
147
+
$ docker run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp -e GOOS=windows -e GOARCH=386 golang:1.22 go build -v
148
148
```
149
149
150
150
Alternatively, you can build for multiple platforms at once:
Copy file name to clipboardExpand all lines: python/README.md
+6-1Lines changed: 6 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -199,7 +199,12 @@ This tag is based off of [`buildpack-deps`](https://hub.docker.com/_/buildpack-d
199
199
200
200
## `python:<version>-slim`
201
201
202
-
This image does not contain the common packages contained in the default tag and only contains the minimal packages needed to run `python`. Unless you are working in an environment where *only* the `python` image will be deployed and you have space constraints, we highly recommend using the default image of this repository.
202
+
This image does not contain the common Debian packages contained in the default tag and only contains the minimal Debian packages needed to run `python`. Unless you are working in an environment where *only* the `python` image will be deployed and you have space constraints, we highly recommend using the default image of this repository.
203
+
204
+
When using this image `pip install` will work if a suitable built distribution is available for the Python distribution package being installed. `pip install` may fail when installing a Python distribution package from a source distribution. This image does not contain the Debian packages required to compile extension modules written in other languages. Possible solutions if a `pip install` fails include:
205
+
206
+
- Use this image and install any required Debian packages before running `pip install`.
207
+
- Use the default image of this repository. The default image contains the most commonly required Debian packages. The majority of arbitrary `pip install`s should be successful without additional header/development Debian packages.
0 commit comments