Learn Docker With My Newest Course

Dive into Docker takes you from "What is Docker?" to confidently applying Docker to your own projects. It's packed with best practices and examples. Start Learning Docker →

Replace Docker Access Tokens in GitHub Actions with an OIDC Connection

replace-docker-access-tokens-in-github-actions-with-an-oidc-connection.jpg

Avoid creating and managing long-lived tokens by setting this up. You can have fine grained control over the rules too.

Quick Jump:

I put together an end to end example of this here https://github.com/nickjj/docker-oidc-example. It covers creating a GitHub repo, Docker repo, setting up the Docker OIDC connection, building multi-architecture Docker images in a GitHub Action, publishing those images to your Docker repo and testing it all end to end.

It’ll work with public or private repos, both on GitHub or the Docker Hub.

The video below shows everything.

# Demo Video

Timestamps

  • 0:52 – We’ll do everything in this video
  • 1:39 – Creating a repo on GitHub and Docker Hub
  • 3:41 – Details and locally testing it
  • 5:52 – Create the Docker OIDC connection
  • 12:38 – Adding a few GitHub repo variables
  • 14:35 – Going over the GitHub Action
  • 16:16 – Testing it out end to end
  • 18:30 – Pulling it locally as a final test
  • 19:39 – Making everything open source

Are you going to be using this Docker feature? Let me know below.

Never Miss a Tip, Trick or Tutorial

Like you, I'm super protective of my inbox, so don't worry about getting spammed. You can expect a few emails per year (at most), and you can 1-click unsubscribe at any time. See what else you'll get too.



Comments