Skip to main content
Redhat Developers  Logo
  • Products

    Platforms

    • Red Hat Enterprise Linux
      Red Hat Enterprise Linux Icon
    • Red Hat AI
      Red Hat AI
    • Red Hat OpenShift
      Openshift icon
    • Red Hat Ansible Automation Platform
      Ansible icon
    • View All Red Hat Products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat Developer Hub
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat OpenShift Local
    • Red Hat Developer Sandbox

      Try Red Hat products and technologies without setup or configuration fees for 30 days with this shared Openshift and Kubernetes cluster.
    • Try at no cost
  • Technologies

    Featured

    • AI/ML
      AI/ML Icon
    • Linux
      Linux Icon
    • Kubernetes
      Cloud icon
    • Automation
      Automation Icon showing arrows moving in a circle around a gear
    • View All Technologies
    • Programming Languages & Frameworks

      • Java
      • Python
      • JavaScript
    • System Design & Architecture

      • Red Hat architecture and design patterns
      • Microservices
      • Event-Driven Architecture
      • Databases
    • Developer Productivity

      • Developer productivity
      • Developer Tools
      • GitOps
    • Automated Data Processing

      • AI/ML
      • Data Science
      • Apache Kafka on Kubernetes
    • Platform Engineering

      • DevOps
      • DevSecOps
      • Ansible automation for applications and services
    • Secure Development & Architectures

      • Security
      • Secure coding
  • Learn

    Featured

    • Kubernetes & Cloud Native
      Openshift icon
    • Linux
      Rhel icon
    • Automation
      Ansible cloud icon
    • AI/ML
      AI/ML Icon
    • View All Learning Resources

    E-Books

    • GitOps Cookbook
    • Podman in Action
    • Kubernetes Operators
    • The Path to GitOps
    • View All E-books

    Cheat Sheets

    • Linux Commands
    • Bash Commands
    • Git
    • systemd Commands
    • View All Cheat Sheets

    Documentation

    • Product Documentation
    • API Catalog
    • Legacy Documentation
  • Developer Sandbox

    Developer Sandbox

    • Access Red Hat’s products and technologies without setup or configuration, and start developing quicker than ever before with our new, no-cost sandbox environments.
    • Explore Developer Sandbox

    Featured Developer Sandbox activities

    • Get started with your Developer Sandbox
    • OpenShift virtualization and application modernization using the Developer Sandbox
    • Explore all Developer Sandbox activities

    Ready to start developing apps?

    • Try at no cost
  • Blog
  • Events
  • Videos

How to use Go Toolset container images

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

Share:

    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

    • A deep dive into Apache Kafka's KRaft protocol

    • Staying ahead of artificial intelligence threats

    • Strengthen privacy and security with encrypted DNS in RHEL

    • How to enable Ansible Lightspeed intelligent assistant

    • Why some agentic AI developers are moving code from Python to Rust

    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

    Products

    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform

    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
    © 2025 Red Hat

    Red Hat legal and privacy links

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

    Report a website issue