Choose a tested workflow
The live functional check and repeated benchmark record these results. Docker-based actions and whole-job
container: configurations were not separately established by those checks; validate your chosen action or job image before migrating it.
Build and run an image
This example uses the published Python fixture, which includes locked dependencies and a self-test. Save it as.github/workflows/docker.yml in a connected repository:
.github/workflows/docker.yml
42. This self-test checks the application image; it does not connect to a database.
Large provides 4 vCPU and 16 GB RAM and requires eligible workspace credit. It is the size used for the repeated benchmark, not a minimum requirement for all Docker jobs. Select a runner size for your application’s needs.
Add databases and storage tests
Use the complete Docker and Compose walkthrough for:- A Compose file with PostgreSQL, Azurite, and a Python API.
- Health checks followed by real SQL inserts and an Azure Blob upload/download.
- A native GitHub PostgreSQL
services:example. - Cleanup steps that run even when tests fail.
Authenticate image pulls before they happen
At higher job volumes, unauthenticated Docker Hub pulls can reach registry limits. Store registry credentials in GitHub Actions secrets and authenticate before step-level pulls. GitHub pullsservices: images before executing job steps. Put credentials in the service’s credentials configuration when the registry requires authentication; a later docker login step is too late for that pull. The walkthrough includes both patterns.
Check cache and CPU-limit compatibility
The October 17 benchmark found two failures on Celesto:- Direct BuildKit cache export with
type=gha,version=2failed preflight. - Docker’s explicit
--cpusflag failed preflight.
actions/cache. These alternatives passed their checks; they do not establish that the failing options are fixed.
Each job gets a fresh computer. Local Docker images and build layers do not automatically survive into the next job. Compare complete build time, including cache transfer and import, before choosing a cache strategy. See benchmarking for the measured tradeoffs.
For a failing migration, retain the Actions logs and runner size, and contact support with a workflow that has secrets removed.