Reproduce a Travis CI build locally with Docker
Shows how to fix reproduce a Travis CI build locally with Docker. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
Use Docker on your machine to recreate the Travis build environment for the job, following the common-build-problems doc referenced in the thread: set up a temporary build id, pull the same image Travis uses, and run the job steps inside it.
Steps
- Use Docker on your machine to recreate the Travis build environment for the job, following the common-build-problems doc referenced in the thread: set up a temporary build id, pull the same image Travis uses, and run the job steps inside it. You can interrupt the process at any time to inspect state, which beats pushing commits to iterate. This only works for jobs that have already run on Travis at least once, since you need the build log to mirror the environment.
When to use
You are seeing this: You can interrupt the process at any time to inspect state, which beats pushing commits to iterate. Use this skill when you run into "Reproduce a Travis CI build locally with Docker".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.