Building Docker in CI
GitHub Actions runners (like ubuntu-latest) come with Docker pre-installed!
This means you can run standard Docker commands directly in your run steps.
jobs:
build-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build the Docker image
run: docker build -t myapp:latest .
Alternatively, Docker provides official Actions (docker/build-push-action@v5) which offer advanced features like caching layers using GitHub Actions cache to drastically speed up build times.
booting...