Hello,
there is documentation about building Unreal Engine 4 projects in a development container:
This works fine for me locally:
$ docker run \
--rm -ti -v "$(pwd):/project" \
ghcr.io/epicgames/unreal-engine:dev-4.27 \
/home/ue4/UnrealEngine/Engine/Build/BatchFiles/RunUAT.sh \
BuildCookRun \
-utf8output -platform=Linux \
-clientconfig=Shipping -serverconfig=Shipping \
-project=/project/VR_Frontend.uproject \
-noP4 \
-nodebuginfo -allmaps \
-cook \
-build \
-stage \
-prereqs \
-pak \
-archive \
-archivedirectory=/project/Packaged
However, when I run the same command in a job of a GitLab continuous integration pipeline on the same code in a Docker-in-Docker (dind) image, I cannot mount the volume:
$ docker run
--rm \
--volume $PROJECT_PATH:/home/ue4/UnrealEngine/VR_Frontend/ -w \
/home/ue4/UnrealEngine/VR_Frontend/ -i \
ghcr.io/epicgames/unreal-engine:dev-4.27 \
ls -A /home/ue4/UnrealEngine/VR_Frontend
tmp.eMGbml
I have already tried specifying the --volumes-from
command line flag, but that does not make a difference:
$ docker run \
--rm \
--volume $PROJECT_PATH:/home/ue4/UnrealEngine/VR_Frontend/ \
-w /home/ue4/UnrealEngine/VR_Frontend/ \
-i ghcr.io/epicgames/unreal-engine:dev-4.27 \
ls -A
tmp.eMGbml
Please document a way to build unreal projects in GitLab CI using the development containers.
My current idea is to do it the other way around:
- Make GitLab CI build a Dockerfile.
- Base said Dockerfile on the development Unreal image
- install git
- clone my Unreal project content repository into the container
- do not upload the image to the GitLab project registry
- copy the compiled contents from the built docker image to the CI environment
- configure GitLab CI to store the compiled contents as artifacts
This seems cumbersome. Is there a better way?
Another idea: Don’t mount, copy!
- Start the Unreal development image with an entry point of sleep infinity.
- Copy the Unreal application files to the image.
- Run the BuildCookRun command on the image.
- Copy the compiled files to the host.
- Add the compiled files to GitLab’s artifacts.