I’ve been looking into implementing a CI pipeline for UE4 projects, and I noticed that there only seemed to be a handful of outdated Linux Dockerfiles for UE4 floating around on GitHub (and most of those were geared towards running the Editor in a container, not providing a build environment suitable for a CI pipeline.) So I set about experimenting and ended up creating a set of Dockerfiles and an accompanying Python build script that provide the necessary functionality to build both Windows and Linux Docker images for UE4.19. (Other versions should work as well, but I’ve only tested 4.19 thus far.)
You can check out the code and associated documentation here: GitHub - adamrehn/ue4-docker: Windows and Linux containers for Unreal Engine 4
I ran into quite a few frustrations along the way (especially with the Windows container version), and I’ve documented these issues and their solutions here: Building Docker images for Unreal Engine 4 - Adam Rehn
Hopefully people find these containers useful!