In the last few days, I’ve been exploring what is docker and how to run Unity on it. Indeed, I’ve used GameCI in the past and worked good for me, nonetheless, I wanted something simple and from scratch.
something like docker + unity for dummies.
While investigating it, I found important resources that are not easily found when googling about it, e.g.,
- Unity Hub CLI guide: https://docs.unity3d.com/hub/manual/HubCLI.html
- Unity Hub changelog: https://unity.com/unity-hub/release-notes
With it, I built a minimal set of files for using a Ubuntu 18.04 container with Unity hub + Unity 2021.3 + Android submodules. https://github.com/seprab/UnityDockerBuilder
Other than the bunch of documention in the web, I learn:
- A Unity pro/plus account is required to run Unity in CLI because a personal license cannot be activated without GUI.
- Unity don’t support docker. Nonetheless, it is on their roadmap, and under consideration: Product board portal
- The Unity Hub is not working well in docker containers. So, Installing the editor directly might be a better option. Still, installing submodules (e.g., JDK, NDK) can be a headache.
- It is necessary to specify all the submodules to install Unity with Android automatically
-m android -m android-sdk-ndk-tools -m android-open-jdk
. Otherwise, if the command lacks of one module, the Hub will request user input, and since it is unsupervised, the docker image creation fail. - When installing the editor version, the changeset is a must. Otherwise, the hub will fail when looking for the editor version to install.
- I was running out of disk space when running my tests, and docker instance broke. Then, it prompt me to choose deleting the images and containers for recovering docker. Otherwise, I couldn’t continue making use of it.
I plan to continue working on this repo. I’ll feed the repo readme with my future plans.