Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. GitHub Actions
  3. Publish a docker image to Dockerhub

Publish a docker image to Dockerhub

MITShellv5

A GitHub Action that builds and publishes Docker images to registries using Git branches as tags.

GitHubGitHub
792 stars204 forks0 contributors

What is Publish a docker image to Dockerhub?

Publish-Docker-Github-Action is a GitHub Action that automates building and publishing Docker images to container registries as part of CI/CD pipelines. It solves the problem of manually managing Docker image builds and pushes by integrating directly into GitHub workflows, using Git branches for automatic tagging and supporting various registries and advanced build options.

Target Audience

Developers and DevOps engineers using GitHub Actions for CI/CD who need to automate Docker image builds and publications to registries like Docker Hub, GitHub Container Registry, or custom registries.

Value Proposition

Developers choose this action for its simplicity, flexibility, and deep integration with GitHub Actions. It reduces pipeline complexity with automatic branch-based tagging, supports advanced features like multi-platform builds and caching, and is widely trusted in the community with extensive configuration options for production use.

Overview

A Github Action used to build and publish Docker images

Use Cases

Best For

  • Automating Docker image builds and pushes in GitHub Actions workflows
  • Setting up CI/CD pipelines for containerized applications
  • Publishing Docker images to multiple registries (Docker Hub, GHCR, custom)
  • Implementing semantic versioning for Docker tags
  • Building multi-architecture Docker images (e.g., amd64 and arm64)
  • Optimizing build times with layer caching for large Docker images

Not Ideal For

  • Teams using CI/CD platforms other than GitHub Actions (e.g., GitLab CI, Jenkins)
  • Projects requiring built-in security scanning or image signing in the build pipeline
  • Workflows that need to manage multi-container applications or integrate Docker Compose beyond image publishing
  • Environments where manual, fine-grained control over image tagging without automatic branch-based rules is essential

Pros & Cons

Pros

Automated Branch Tagging

Automatically uses Git branch names for Docker tags, with the master branch published as 'latest', simplifying CI/CD setup and reducing manual configuration.

Multi-Registry Flexibility

Supports publishing to Docker Hub, GitHub Container Registry, and custom registries with easy authentication via secrets, as shown in the README examples.

Advanced Tag Management

Offers options for custom tags, semantic versioning tags, and snapshot tags with timestamps, enabling robust and automated versioning strategies.

Build Customization Options

Allows specifying Dockerfile, build context, working directory, build arguments, and build options, catering to complex image build requirements.

Cons

Cache Management Complexity

The caching feature requires careful handling to avoid stale packages, with the README warning about periodic rebuilds and potential non-reproducible builds.

Risk of Tag Overwrites

Using tag_names or tag_semver can lead to images being overridden by branches with the same name, with no restoration method, as cautioned in the README.

External Dependencies for Multi-Platform

Multi-platform builds necessitate prior setup of docker/setup-buildx-action, adding an extra step and potential integration overhead.

Frequently Asked Questions

Quick Stats

Stars792
Forks204
Contributors0
Open Issues0
Last commit12 days ago
CreatedSince 2019

Tags

#actions#devops#push#publishing#aws-ecr#docker-build#build-automation#ci-cd#docker#multi-platform#continuous-delivery#container-registry#automation#build#github-actions

Included in

GitHub Actions27.6k
Auto-fetched 4 hours ago

Related Projects

Run GitHub Actions Locally in TerminalRun GitHub Actions Locally in Terminal

Run your GitHub Actions locally 🚀

Stars71,058
Forks1,972
Last commit3 days ago
Publish GitHub Releases with AssetsPublish GitHub Releases with Assets

📦 :octocat: GitHub Action for creating GitHub Releases

Stars5,690
Forks634
Last commit15 hours ago
Push Git changes to GitHub repository without authentication difficultiesPush Git changes to GitHub repository without authentication difficulties

GitHub actions to push back to repository eg. updated code

Stars1,277
Forks239
Last commit1 month ago
Enforce Policies on GitHub Repositories and CommitsEnforce Policies on GitHub Repositories and Commits

Policy enforcement for your pipelines.

Stars524
Forks63
Last commit5 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub