GithubHelp home page GithubHelp logo

docker-unity3d's Introduction

Unity3d docker image

Docker Stars Docker Pulls Docker Automated build Image Version

About this image

This docker image was based on GitLab CI with Unity3D in Docker and Unity3d docker image for running commands in CI such as gitlab-ci.

Linux Unity3d builds are taken from Unity on Linux: Release Notes and Known Issues

Things to consider

This docker image runs in a terminal so you don't have access to the UI. This docker image is intended to run unity commands with the command line. You can use it for running tests and creating builds.

Usage

Activate

  1. Pull the docker image and run it
UNITY_VERSION=2018.3.0f2
[email protected]
UNITY_PASSWORD=yourPassword
docker run -it --rm \
  -e "HOSTUID=`id -u`" \
  -e "HOSTGID=`id -g`" \
  -e "UNITY_USERNAME=$UNITY_USERNAME" \
  -e "UNITY_PASSWORD=$UNITY_PASSWORD" \
  -e "WORKDIR=/work" \
  -v "$(pwd):/work" \
  wtanaka/unity3d:"$UNITY_VERSION" \
  bash
  1. Run this to try to activate Unity
xvfb-run --auto-servernum --server-args='-screen 0 640x480x24' \
/opt/Unity/Editor/Unity \
-logFile \
-batchmode \
-username "$UNITY_USERNAME" -password "$UNITY_PASSWORD"
  1. Wait for output that looks like this:
LICENSE SYSTEM [2017723 8:6:38] Posting <?xml version="1.0" encoding="UTF-8"?><root><SystemInfo><IsoCode>en</IsoCode><UserName>[...]
  1. Copy xml content and save as unity3d.alf
  2. Open https://license.unity3d.com/manual and answer questions
  3. Upload unity3d.alf for manual activation
  4. Download Unity_v2018.x.ulf
  5. Copy the content of Unity_v2018.x.ulf license file to your CI's environment variable UNITY_LICENSE_CONTENT.

Running play mode tests

UNITY_LICENSE_CONTENT="`cat Unity_v2018.x.ulf`"
export UNITY_LICENSE_CONTENT
UNITY_VERSION=2018.3.0f2
export UNITY_VERSION
docker run -it --rm \
  -e "HOSTUID=`id -u`" \
  -e "HOSTGID=`id -g`" \
  -e "TEST_PLATFORM=playmode" \
  -e UNITY_LICENSE_CONTENT \
  -e "WORKDIR=/work" \
  -v "$(pwd):/work" \
  wtanaka/unity3d:"$UNITY_VERSION" \
  /xvfb_runtests.sh

Running edit mode tests

UNITY_LICENSE_CONTENT="`cat Unity_v2018.x.ulf`"
export UNITY_LICENSE_CONTENT
UNITY_VERSION=2018.3.0f2
export UNITY_VERSION
docker run -it --rm \
  -e "HOSTUID=`id -u`" \
  -e "HOSTGID=`id -g`" \
  -e "TEST_PLATFORM=editmode" \
  -e UNITY_LICENSE_CONTENT \
  -e "WORKDIR=/work" \
  -v "$(pwd):/work" \
  wtanaka/unity3d:"$UNITY_VERSION" \
  /xvfb_runtests.sh

Building

UNITY_LICENSE_CONTENT="`cat Unity_v2018.x.ulf`"
export UNITY_LICENSE_CONTENT
UNITY_VERSION=2018.3.0f2
export UNITY_VERSION
docker run -it --rm \
  -e "HOSTUID=`id -u`" \
  -e "HOSTGID=`id -g`" \
  -e "TEST_PLATFORM=playmode" \
  -e UNITY_LICENSE_CONTENT \
  -e "WORKDIR=/work" \
  -v "$(pwd):/work" \
  wtanaka/unity3d:"$UNITY_VERSION" \
  /opt/Unity/Editor/Unity \
  -projectPath . \
  -quit -batchmode -nographics \
  -buildTarget WebGL \
  -customBuildTarget WebGL \
  -customBuildName TheBuildName \
  -customBuildPath TheBuild \
  -customBuildOptions AcceptExternalModificationsToPlayer \
  -executeMethod BuildCommand.PerformBuild \
  -logFile

License

MIT © Gabriel Le Breton

docker-unity3d's People

Contributors

gableroux avatar tormath1 avatar wtanaka avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.