Skip to main content
Redhat Developers  Logo
  • AI

    Get started with AI

    • Red Hat AI
      Accelerate the development and deployment of enterprise AI solutions.
    • AI learning hub
      Explore learning materials and tools, organized by task.
    • AI interactive demos
      Click through scenarios with Red Hat AI, including training LLMs and more.
    • AI/ML learning paths
      Expand your OpenShift AI knowledge using these learning resources.
    • AI quickstarts
      Focused AI use cases designed for fast deployment on Red Hat AI platforms.
    • No-cost AI training
      Foundational Red Hat AI training.

    Featured resources

    • OpenShift AI learning
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

    Red Hat AI Factory with NVIDIA

    • Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.
    • Explore the solution
  • Learn

    Self-guided

    • Documentation
      Find answers, get step-by-step guidance, and learn how to use Red Hat products.
    • Learning paths
      Explore curated walkthroughs for common development tasks.
    • Guided learning
      Receive custom learning paths powered by our AI assistant.
    • See all learning

    Hands-on

    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.
    • Interactive labs
      Learn by doing in these hands-on, browser-based experiences.
    • Interactive demos
      Click through product features in these guided tours.

    Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics

    Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
  • Build

    Get started

    • Red Hat build of Podman Desktop
      A downloadable, local development hub to experiment with our products and builds.
    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.

    Download products

    • Access product downloads to start building and testing right away.
    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset

    References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
  • Community

    Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions

    Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github

    Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

    Join the Red Hat Developer program

    • Download Red Hat products and project builds, access support documentation, learning content, and more.
    • Explore the benefits

How to use Go Toolset container images

July 21, 2022
Alejandro Sáez Morollón
Related topics:
ContainersGo
Related products:
Developer ToolsetRed Hat Enterprise Linux

    The Go Toolset package delivers the Go language with Federal Information Processing Standard (FIPS) support for cryptographic modules and the Delve debugger to Red Hat Enterprise Linux customers. We introduced this package a few years ago. Now we also provide Go Toolset in container images. This article illustrates how these images support modern Go development.

    Obtaining Go Toolset container images

    The images are in Red Hat's container image catalog. Search for go-toolset here. As of this writing, we have images based on Red Hat Enterprise Linux 7, Red Hat Enterprise Linux 8, and Red Hat Universal Base Images (UBI) 7 and 8. To learn more about UBI, check the article Red Hat UBI is a Verified Publisher on Docker Hub.

    If you don't want to use the Go Toolset container image, you can still install the Go Toolset package inside a ubi8 container. Just run dnf install go-toolset inside the registry.access.redhat.com/ubi8 image, and you'll be all set.

    Pull the latest version of the Go Toolset image

    Using your container engine is the best way to pull down a container image. Let's use Podman for this example. The following commands pull down the latest version of the image based on UBI 8 and run a shell inside it:

    [alex@lab ~]$ podman pull registry.access.redhat.com/ubi8/go-toolset:latest
    [alex@lab ~]$ podman run --rm -it go-toolset /bin/bash
    bash-4.4$ go version
    go version go1.17.7 linux/amd64
    bash-4.4$ exit
    exit
    [alex@lab ~]$

    Using the image in a multistage environment

    You can refer to the image in a Dockerfile like any other image and use it, for example, as a build step in a multistage Dockerfile in tandem with the Red Hat Universal Base Image 8 Micro image:

    FROM ubi8/go-toolset as build
    COPY ./src .
    
    RUN go mod init my_app && \
        go mod tidy && \
        go build .
    
    FROM ubi8/ubi-micro
    COPY --from=build /opt/app-root/src/my_app .
    CMD ./my_app

    The ubi-micro image takes up less than 40MB, so the surface of your container is tiny but holds all of the great features UBI delivers.

    Go Toolset works with Toolbox

    I won’t be lying if I say Toolbox is one of my favorite software tools. It allows you to keep working with your files and configurations inside a new container. I use Toolbox every day, and it works wonderfully with the Go Toolset image.

    You can install Toolbox in both Red Hat Enterprise Linux and Fedora with dnf install toolbox. The toolbox command lets you install other resources:

    [alex@lab ~]$ cat /etc/redhat-release
    Fedora release 35 (Thirty Five)
    [alex@lab ~]$ toolbox create --image registry.access.redhat.com/ubi8/go-toolset
    [alex@lab ~]$ toolbox enter go-toolset
    [alex@toolbox ~]$ cat /etc/redhat-release
    Red Hat Enterprise Linux release 8.6 (Ootpa)

    Now you have all the files, configurations, and packages included with the image.

    Attach VS Code for IDE support

    You can improve productivity by attaching Visual Studio Code, VS Code to a running container. Install the Remote Containers extension and execute Attach to Running Container. There is no need to configure Git or Kerberos tokens; simply jump into the container and start working.

    I use this process to play with the new versions of the container images we built and bootstrap projects such as Go.

    Go Toolset includes FIPS security

    One exciting feature supported by the golang package in Go Toolset is FIPS 140-2 cryptographic modules. You can expect Go Toolset to follow the FIPS 140-2 security standard. Check for FIPS mode inside the Go Toolset container image:

    [alex@lab ~]$ fips-mode-setup --check
    FIPS mode is enabled.
    [alex@lab ~]$ toolbox enter go-toolset
    [alex@toolbox ~]$ fips-mode-setup --check
    FIPS mode is enabled.

    Enterprise-ready Go in Red Hat Enterprise Linux

    The Go Toolset package is available as an image and integrates smoothly with other popular developer tools. By following the instructions I have provided, you can quickly become a more productive Go programmer in the cloud.

    Last updated: October 30, 2024

    Related Posts

    • Getting started with go-toolset

    • Building freely distributed containers with Podman and Red Hat UBI

    • XML Language Server and the VSCode Extension

    • Using Delve to debug Go programs on Red Hat Enterprise Linux

    • Is your Go application FIPS compliant?

    Recent Posts

    • Every layer counts: Defense in depth for AI agents with Red Hat AI

    • Fun in the RUN instruction: Why container builds with distroless images can surprise you

    • Trusted software factory: Building trust in the agentic AI era

    • Build a zero trust AI pipeline with OpenShift and RHEL CVMs

    • Red Hat Hardened Images: Top 5 benefits for software developers

    What’s up next?

    cheat sheet cover image

    Podman is one of the next-generation container tools (along with Buildah and Skopeo) included in Red Hat Enterprise Linux. The Podman Basics Cheat Sheet covers all of the commands that focus on images, containers, and container resources.

    Get the cheat sheet
    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Chat Support

    Please log in with your Red Hat account to access chat support.