Docker
/Intermediate
GitHub Actions + Docker
Definition
The use of GitHub's native CI/CD platform to automatically build Docker images from a repository's Dockerfile and push them to a registry whenever code is merged.
Explain Like I'm New
A robot that lives in your GitHub repo. You merge a Pull Request, the robot wakes up, runs `docker build`, and uploads the new version of your app to the cloud automatically.
Real World Example
You write a `.github/workflows/docker.yml` file. It tells GitHub: 'Every time a commit hits the main branch, log into AWS ECR, run docker build, tag it with the commit hash, and push it.'
Common Use Cases
- •Open-source workflows
- •Automated releases
Interview Questions
basic
- Can GitHub Actions automatically push a Docker Image to Docker Hub for you?
intermediate
- How do you securely pass your Docker Hub password to a GitHub Actions workflow?