go-docker-builds

Generates a production-grade, multi-stage Dockerfile for Go services with CGO handling, non-root execution, CA certificates, health checks, CI integration.

1|1|Updated May 3, 2026
One-click install
npx skills add https://github.com/matt-riley/agent-skills --skill go-docker-builds
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-docker-builds
Source: https://github.com/matt-riley/agent-skills/tree/main/skills/go-docker-builds
Command: npx skills add https://github.com/matt-riley/agent-skills --skill go-docker-builds

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Containerizing Go services for production can be error-prone without a canonical multi-stage Docker workflow. This skill provides a guided, production-ready approach to build, test, and run Go applications in minimal images, with health checks, non-root execution, and CI integration.

Core Features & Use Cases

  • Canonical multi-stage Go Dockerfile patterns for static binaries.
  • CGO handling, CA certificates, and non-root hardening guidance.
  • CI integration tips for automated image pushes.

Quick Start

Create a production-grade Dockerfile that builds a static Go binary with a multi-stage approach and runs on a scratch base image.

Frequently Asked Questions about go-docker-builds

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is a production-grade multi-stage Dockerfile for Go?

The best way to containerize Go services is using a canonical multi-stage Docker build that produces static binaries, handles CGO dependencies, and runs on a minimal scratch or distroless base with non-root hardening.

How do I handle CGO dependencies when building Go Docker images?

To handle CGO dependencies when building Go Docker images, you configure proper CGO settings during the multi-stage build process to ensure the final binary is statically linked and ready for a scratch base image.

Does this approach support CI integration for automated image pushes?

Yes, this Docker build approach supports CI integration by applying canonical multi-stage patterns and secure image hardening practices that can be automated for continuous integration and deployment pipelines.

How do I add health checks to a Go scratch container?

You add health checks to a Go scratch container by incorporating health check configurations into the Dockerfile, ensuring the server-ready application running on the minimal base image can be monitored for availability.

Can I use distroless base images with Go applications?

Yes, you can use distroless base images with Go applications by leveraging a multi-stage Docker build that compiles a static binary and includes necessary CA certificates for secure non-root execution.