Skip to content

tahv/docker-mayapy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-mayapy

Autodesk Maya images on ubuntu:22.04.

Supported tags

Reference

Usage

Interactive

Run in interactive mode.

docker run -it --rm tahv/mayapy:latest

Start mayapy inside the container.

$ mayapy
>>> import maya.standalone
>>> maya.standalone.initialize()
>>> from maya import cmds
>>> from maya.api import OpenMaya

As Github workflow

Use tahv/mayapy as your job image.

name: Mayapy

on: [push]

jobs:
   build:
    name: Mayapy
    runs-on: ubuntu-latest
    container:
      image: tahv/mayapy:latest
    steps:
      - name: Print Maya version
        run: mayapy -c "import maya.standalone; maya.standalone.initialize(); from maya import cmds; print(cmds.about(v=True))"

Or use a matrix to run on multiple versions.

name: Mayapy

on: [push]

jobs:
  build:
    name: Mayapy ${{ matrix.maya-version }}
    runs-on: ubuntu-latest
    strategy:
      matrix:
        maya-version:
          - "2022"
          - "2023"
          - "2024"
          - "2025"
    container:
      image: tahv/mayapy:${{ matrix.maya-version }}
    steps:
      - name: Print Maya version
        run: mayapy -c "import maya.standalone; maya.standalone.initialize(); from maya import cmds; print(cmds.about(v=True))"

Notes

Installed softwares

Pre-installed:

  • git
  • wget

/usr/autodesk/maya/bin is added to PATH, exposing:

  • pip (invoke it with python -m pip)
  • mayapy
  • python (symlink of mayapy)

Installed libraries

Additional libraries are installed following Autodesk documentation.

libxp6

libxp6 is installed from ppa:zeehio/libxp as recommanded by Autodesk.

The archive has removed libxp6 because it is obsolete and the last build is on Ubuntu 22.04.

Removed directories

  • /usr/autodesk/maya/Examples is removed from the images to save ~1G of space.

Exit code

Maya will set the exit code to 0 when standalone crashes. All images set MAYA_NO_STANDALONE_ATEXIT=1 to make maya return a non 0 exit code.

Disabling analytics

All images set MAYA_DISABLE_ADP=1 to opt-out of analytics when starting Maya in batch mode, which can cause a hang on close.

Development

Clone the repo, cd into it and build an image from one of the directories.

git clone https://github.com/tahv/docker-mayapy
cd docker-mayapy
docker build --platform linux/amd64 -t tahv/mayapy:2025 2025
docker run -it --rm mayapy:2025

Debugging

Debugging tips for creating new images, in no particular order.

List missing dependencies.

ldd /usr/autodesk/maya/lib/* 2> /dev/null | sed -nE 's/\s*(.+) => not found/\1/p' | sort --unique

Set this variable to make Qt print out diagnostic information about each plugin it tries to load.

export QT_DEBUG_PLUGINS=1

Read Maya ubuntu_README.txt for information on how to fix potential versioning issues with libssl and libcrypto.

cat /usr/autodesk/maya/support/python/*/ubuntu_README.txt

Initialize Maya and load plugins to catch missing dependencies.

mayapy -c "import maya.standalone; maya.standalone.initialize(); from maya import cmds; cmds.loadPlugin('fbxmaya'); cmds.loadPlugin(a=True)"