Replace Docker Access Tokens in GitHub Actions with an OIDC Connection

Avoid creating and managing long-lived tokens by setting this up. You can have fine grained control over the rules too.
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.