Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Activating Unity-2018.3.f02 using a pro license in a docker container

Discussion in 'Linux' started by kyip2, Jan 22, 2019.

  1. kyip2

    kyip2

    Joined:
    Jul 10, 2018
    Posts:
    12
    In my CI/CD pipeline I need to build asset bundles hence I need to activate Unity using a PRO license. Has anybody had any success doing this? My Dockerfile is fairly simple:

    FROM ubuntu:18.04
    RUN apt-get -qq update && apt-get -qq install -y \
    gconf-service \
    lib32gcc1 \
    lib32stdc++6 \
    libasound2 \
    libc6 \
    libc6-i386 \
    libcairo2 \
    libcap2 \
    libcups2 \
    libdbus-1-3 \
    libexpat1 \
    libfontconfig1 \
    libfreetype6 \
    libgcc1 \
    libgconf-2-4 \
    libgdk-pixbuf2.0-0 \
    libgl1-mesa-glx \
    libglib2.0-0 \
    libglu1-mesa \
    libgtk2.0-0 \
    libnspr4 \
    libnss3 \
    libpango1.0-0 \
    libstdc++6 \
    libx11-6 \
    libxcomposite1 \
    libxcursor1 \
    libxdamage1 \
    libxext6 \
    libxfixes3 \
    libxi6 \
    libxrandr2 \
    libxrender1 \
    libxtst6 \
    zlib1g \
    debconf \
    npm \
    xdg-utils \
    lsb-release \
    libpq5 \
    xvfb \
    wget \
    libsoup2.4.1 \
    libarchive13 \
    libgtk-3-0
    ADD UnitySetup-2018.3.0f2 /tmp
    RUN yes | /tmp/UnitySetup-2018.3.0f2 --unattended --components=Unity,Mac-Mono,Windows-Mono --install-location=/opt/Unity-2018.3.0f2

    However after running the container and attempting to activate with the -batchmode -quit -nographics -serial -username -password options, it fails and I have no idea why. I tried it inside a linux VM, which works fine so I'm stumped as to why the licensing module doesn't work inside a docker container.

    Has anybody solved this problem?
     
  2. PixelJ

    PixelJ

    Unity Technologies

    Joined:
    Nov 1, 2018
    Posts:
    216
  3. kyip2

    kyip2

    Joined:
    Jul 10, 2018
    Posts:
    12
    I've submitted a bug report.

    After entering this line (substitute in valid credentials):

    /opt/Unity/Editor/Unity -batchmode -quit -nographics -logfile -serial xx-xxxx-xxxx-xxxx-xxxx-xxxx -username 'somebody@somecompany.com' -password 'xxxxxxxx'

    This is the output:

    Initiating legacy licensing moduleDisplayProgressbar: Unity license
    [0123/222616:ERROR:browser_main_loop.cc(161)] Running without the SUID sandbox! See https://code.goo
    Cancelling DisplayDialog: Failed to activate/update license. Timeout occured while trying to update
    This should not be called in batch mode.

    (Filename: /home/builduser/buildslave/unity/build/Editor/Platform/Linux/EditorUtility.cpp Line: 257)
     
    PixelJ likes this.
  4. kyip2

    kyip2

    Joined:
    Jul 10, 2018
    Posts:
    12
    You might have noticed I had a typo in the command line. Should be :

    /opt/Unity-2018.3.0f2/Editor/Unity -batchmode -quit -nographics -logfile -serial xx-xxxx-xxxx-xxxx-xxxx-xxxx -username 'somebody@somecompany.com' -password 'xxxxxxxx'


    I installed it to /opt/Unity-2018.3.0f2 not /opt/Unity.
     
  5. martins_mozeiko_lgsvl

    martins_mozeiko_lgsvl

    Joined:
    Jan 16, 2019
    Posts:
    6
    Yes, we successfully build Windows and Linux binaries with Pro version inside Docker. See the Dockerfile we use here: https://github.com/lgsvl/simulator/tree/master/Docker

    On Jenkins we export UNITY_USERNAME, UNITY_PASSWORD and UNITY_SERIAL env variables. And do following:
    Code (csharp):
    1. export UID=`id -u`
    2. docker-compose run --rm auto-sim-build
    And if you look at previous commits in our repo, you can find how we used Docker to activate & build with Personal edition: https://github.com/lgsvl/simulator/tree/2dd9bcedebd37333dd32dc23ec6b3012d6fc3d6d/Docker

    Activation required to run docker with
    --privileged
    otherwise GUI did not work for whatever reason.
     
  6. kyip2

    kyip2

    Joined:
    Jul 10, 2018
    Posts:
    12
    Cool! I fixed my license activation problem!

    Based on the Dockerfile and unity_build.sh script at https://github.com/lgsvl/simulator/tree/master/Docker I managed to figure out that I was missing the npm package, which the registration module in Unity needs. Furthermore despite the -nographics option, Unity still requires a frame buffer for registration, at least a virtual one, hence the command line should be :

    /usr/bin/xvfb-run /opt/Unity-2018.3.0f2/Editor/Unity -batchmode -quit -nographics -logfile -serial xx-xxxx-xxxx-xxxx-xxxx-xxxx -username 'somebody@somecompany.com' -password 'xxxxxxxx'.

    Also note you're only allowed a max of 2 activations per seat. So deactivating after use is a must.
     
  7. joobs88

    joobs88

    Joined:
    Oct 8, 2015
    Posts:
    1
    Hey @kyip2, which NPM package were you missing? I am trying to do this as well in a docker container but for 2109.4