Return to Image List

golang

golang

Golang is a programming language first developed at Google. It is a statically-typed language with syntax loosely derived from C, but with additional features such as garbage collection, type safety, some dynamic-typing capabilities, additional built-in types (e.g., variable-length arrays and key-value maps), and a large standard library.

See golang.org for more information

This image is built by IBM to run on the IBM Z architecture and is not affiliated with any other community that provides a version of this image.


License

View license information here

As with all Docker images, these likely also contain other software which may be under other licenses (such as Bash, etc from the base distribution, along with any direct or indirect dependencies of the primary software being contained).

As for any pre-built image usage, it is the image user's responsibility to ensure that any use of this image complies with any relevant licenses for all software contained within.


Versions

Use the pull string below for the version of this image you require.
1.25.9-trixie docker pull icr.io/ibmz/golang@sha256:fdfc0aab6e43d8b7472db37c13b089080a380355fb0ef708e974cda10df11bb5 Vulnerability Report06-02-2026
1.26.3-alpine docker pull icr.io/ibmz/golang@sha256:966b3675ec6d8e393cf43bfff09ad436d03af2f37e8746dd7e7499a6dbd1cf4d Vulnerability Report06-02-2026
1.25.7-trixie docker pull icr.io/ibmz/golang@sha256:7b225777cb576955fd0b1758dc8eecfa89f9896684a0898b419cc84634a24d65 Vulnerability Report06-02-2026
1.26.4-trixie docker pull icr.io/ibmz/golang@sha256:565711d17d32530dfb8bfe32938e3a22bbb8e4352abaeeca2b9b122d952a4c33 Vulnerability Report06-02-2026
1.26.4-alpine docker pull icr.io/ibmz/golang@sha256:55867ae4f6e16950848b9b5e41673ab0f23f812127c557b76569f7a8e82e0756 Vulnerability Report06-09-2026
1.25.9-alpine docker pull icr.io/ibmz/golang@sha256:542389cc3e9009354afdb3677d6c619f9842b5dae44855e58af37e618e0d01da Vulnerability Report06-02-2026
1.25.6-alpine docker pull icr.io/ibmz/golang@sha256:4b655f96d63484f558a834800fcff85b134725c46cd5c00cd7c80ced49356408 Vulnerability Report01-15-2026
Version Pull String Security (IBM Cloud) Created

Usage Notes

Building and Running a Go Binary in a Container:
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:

FROM icr.io/ibmz/golang:[version]

WORKDIR /go/src/app
COPY . .

RUN go get -d -v ./...
RUN go install -v ./...

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:

Note: As a security measure, bind mounts are disabled in ZCX. Instead, please use Docker Volumes as illustrated below.

docker create volume [your_volume]


docker run --rm -v [your_volume]:/usr/src/myapp -w /usr/src/myapp icr.io/ibmz/golang:[version] 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 [your_volume]:/usr/src/myapp -w /usr/src/myapp icr.io/ibmz/golang:[version] make


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/... 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 equivilant to 700 for Docker usage, but allowing for --user flexibility.