openeuler/goThe official Go docker image.
Maintained by: openEuler CloudNative SIG.
Where to get help: openEuler CloudNative SIG, openEuler.
Current Go(Golang) docker images are built on the openEuler. This repository is free to use and exempted from per-user rate limits.
Go is expressive, concise, clean, and efficient. Its concurrency mechanisms make it easy to write programs that get the most out of multicore and networked machines, while its novel type system enables flexible and modular program construction. Go compiles quickly to machine code yet has the convenience of garbage collection and the power of run-time reflection. It's a fast, statically typed, compiled language that feels like a dynamically typed, interpreted language.
Learn more on Go website.
The tag of each Go docker image is consist of the version of Go and the version of basic image. The details are as follows
| Tags | Currently | Architectures |
|---|---|---|
| 1.25.6-oe2403sp3 | go 1.25.6 on openEuler 24.03-LTS-SP3 | amd64, arm64 |
| 1.25.4-oe2403sp2 | go 1.25.4 on openEuler 24.03-LTS-SP2 | amd64, arm64 |
| 1.17.3-oe2203lts | go 1.17.3 on openEuler 22.03-LTS | amd64, arm64 |
| 1.21.1-oe2203lts | go 1.21.1 on openEuler 22.03-LTS | amd64, arm64 |
| 1.21.1-oe2203sp3 | go 1.21.1 on openEuler 22.03-LTS-SP3 | amd64, arm64 |
| 1.22.5-oe2203sp4 | go 1.22.5 on openEuler 22.03-LTS-SP4 | amd64, arm64 |
| 1.23.2-oe2003sp4 | go 1.23.2 on openEuler 20.03-LTS-SP4 | amd64, arm64 |
| 1.23.2-oe2203sp1 | go 1.23.2 on openEuler 22.03-LTS-SP1 | amd64, arm64 |
| 1.23.2-oe2203sp3 | go 1.23.2 on openEuler 22.03-LTS-SP3 | amd64, arm64 |
| 1.23.2-oe2203sp4 | go 1.23.2 on openEuler 22.03-LTS-SP4 | amd64, arm64 |
| 1.23.2-oe2403lts | go 1.23.2 on openEuler 24.03-LTS | amd64, arm64 |
| 1.23.3-oe2203sp1 | go 1.23.3 on openEuler 22.03-LTS-SP1 | amd64, arm64 |
| 1.23.3-oe2203sp3 | go 1.23.3 on openEuler 22.03-LTS-SP3 | amd64, arm64 |
| 1.23.3-oe2203sp4 | go 1.23.3 on openEuler 22.03-LTS-SP4 | amd64, arm64 |
| 1.23.3-oe2403lts | go 1.23.3 on openEuler 24.03-LTS | amd64, arm64 |
| 1.23.4-oe2203sp1 | go 1.23.4 on openEuler 22.03-LTS-SP1 | amd64, arm64 |
| 1.23.4-oe2203sp3 | go 1.23.4 on openEuler 22.03-LTS-SP3 | amd64, arm64 |
| 1.23.4-oe2203sp4 | go 1.23.4 on openEuler 22.03-LTS-SP4 | amd64, arm64 |
| 1.23.4-oe2403lts | go 1.23.4 on openEuler 24.03-LTS | amd64, arm64 |
| 1.24.0-oe2203sp1 | go 1.24.0 on openEuler 22.03-LTS-SP1 | amd64, arm64 |
| 1.24.0-oe2203sp3 | go 1.24.0 on openEuler 22.03-LTS-SP3 | amd64, arm64 |
| 1.24.0-oe2203sp4 | go 1.24.0 on openEuler 22.03-LTS-SP4 | amd64, arm64 |
| 1.24.0-oe2403lts | go 1.24.0 on openEuler 24.03-LTS | amd64, arm64 |
| 1.24.1-oe2403lts | go 1.24.1 on openEuler 24.03-LTS | amd64, arm64 |
| 1.24.1-oe2403sp1 | go 1.24.1 on openEuler 24.03-LTS-SP1 | amd64, arm64 |
| 1.24.3-oe2403sp1 | go 1.24.3 on openEuler 24.03-LTS-SP1 | amd64, arm64 |
| 1.24rc1-oe2203sp1 | go 1.24rc1 on openEuler 22.03-LTS-SP1 | amd64, arm64 |
| 1.24rc1-oe2203sp3 | go 1.24rc1 on openEuler 22.03-LTS-SP3 | amd64, arm64 |
| 1.24rc1-oe2203sp4 | go 1.24rc1 on openEuler 22.03-LTS-SP4 | amd64, arm64 |
| 1.24rc1-oe2403lts | go 1.24rc1 on openEuler 24.03-LTS | amd64, arm64 |
Note: /go is world-writable to allow flexibility in the user which runs the container (for example, in a container started with --user 1000:1000, running go get github.com/example/... into the default $GOPATH will succeed). While the 777 directory would be insecure on a regular host setup, there are not typically other processes or users inside the container, so this is equivalent to 700 for Docker usage, but allowing for --user flexibility.
Start a Go instance in your app
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):
# Dockerfile FROM openeuler/go:1.22.5-oe2203sp4 WORKDIR /usr/src/app COPY go.mod go.sum ./ RUN go mod download && go mod verify COPY . . RUN go build -v -o /usr/local/bin/app ./... CMD ["app"]
You can then build and run the Docker image:
docker build -t my-golang-app . docker run -it --rm --name my-running-app my-golang-app
Compile your app inside the Docker container
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:
docker run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp openeuler/go:1.22.5-oe2203sp4 go build -v
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.
docker run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp openeuler/go:1.22.5-oe2203sp4 make
Cross-compile your app inside the Docker container If you need to compile your application for a platform other than linux/amd64 (such as windows/386):
docker run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp -e GOOS=windows -e GOARCH=386 openeuler/go:1.22.5-oe2203sp4 go build -v
Alternatively, you can build for multiple platforms at once:
bash
docker run --rm -it -v "$PWD":/usr/src/myapp -w /usr/src/myapp openeuler/go:1.22.5-oe2203sp4 bash
for GOOS in darwin linux; do for GOARCH in 386 amd64; do export GOOS GOARCH go build -v -o myapp-$GOOS-$GOARCH done done ```
View container running logs
bashdocker logs -f my-go
To get an interactive shell
bashdocker exec -it my-go /bin/bash
If you have any questions or want to use some special features, please submit an issue or a pull request on openeuler-docker-images.

manifest unknown 错误
TLS 证书验证失败
DNS 解析超时
410 错误:版本过低
402 错误:流量耗尽
身份认证失败错误
429 限流错误
凭证保存错误
来自真实用户的反馈,见证轩辕镜像的优质服务