forked from https://gitlab.com/gableroux/unity3d
This project builds docker images for all unity versions and their components. It contains a script that generates a .gitlab-ci.yml
that is used to build and publish all of the images.
all supported versions can be found in ci-generator/unity_versions.yml
(latest built images) and ci-generator/unity_versions.old.yml
(already built images).
These docker images run in a shell so you don't have access to Unity's UI. This docker image is intended to run unity commands with the command line. You can use it for running tests and creating builds.
This docker image is intended to be used with a CI. An example project using unity3d in a docker image can be found at gableroux/unity3d-gitlab-ci-example. Go there and follow its instructions if you'd like to use this image in your project.
Images are built automatically by the CI based on .gitlab-ci.yml
content that is generated by ./ci-generator. If you'd like to build the image by yourself, you can do something like this:
docker build -t gableroux/unity3d:latest . -f unitysetup.Dockerfile
But at this point, you should fork the project, generate the the .gitlab-ci.yml
and let gitlab build the image for you. By default, the images will be published to your fork's registry by default.
docker run -it --rm \
-v "$(pwd):/root/project" \
gableroux/unity3d:latest \
xvfb-run --auto-servernum --server-args='-screen 0 640x480x24' \
/opt/Unity/Editor/Unity -projectPath /root/project
This docker image was first based on GitLab CI with Unity3D in Docker but changed a lot.
Have a look at the issues or merge requests. Have a look at the ci-generator for documentation on how to add the missing version.
Refer to this QA. tldr; I only updated a few environment variables in gitlab-ci settings, this is optional.
I made this for free as a gift to the video game community. If this tool helped you, feel free to become a patron for Totema Studio on Patreon: 🍻
Join us on our discord channel at totema.studio/discord, there's a technical channel in there mostly dedicated to this tool. 👍