Git Product home page Git Product logo

docker-blender's Introduction

linuxserver.io

Blog Discord Discourse Fleet GitHub Open Collective

The LinuxServer.io team brings you another container release featuring:

  • regular and timely application updates
  • easy user mappings (PGID, PUID)
  • custom base image with s6 overlay
  • weekly base OS updates with common layers across the entire LinuxServer.io ecosystem to minimise space usage, down time and bandwidth
  • regular security updates

Find us at:

  • Blog - all the things you can do with our containers including How-To guides, opinions and much more!
  • Discord - realtime support / chat with the community and the team.
  • Discourse - post on our community forum.
  • Fleet - an online web interface which displays all of our maintained images.
  • GitHub - view the source for all of our repositories.
  • Open Collective - please consider helping us by either donating or contributing to our budget

Scarf.io pulls GitHub Stars GitHub Release GitHub Package Repository GitLab Container Registry Quay.io Docker Pulls Docker Stars Jenkins Build LSIO CI

Blender is a free and open-source 3D computer graphics software toolset used for creating animated films, visual effects, art, 3D printed models, motion graphics, interactive 3D applications, virtual reality, and computer games. This image does not support GPU rendering out of the box only accelerated workspace experience

blender

Supported Architectures

We utilise the docker manifest for multi-platform awareness. More information is available from docker here and our announcement here.

Simply pulling lscr.io/linuxserver/blender:latest should retrieve the correct image for your arch, but you can also pull specific arch images via tags.

The architectures supported by this image are:

Architecture Available Tag
x86-64 amd64-<version tag>
arm64 arm64v8-<version tag>
armhf

Application Setup

The application can be accessed at:

Hardware Acceleration

This only applies to your desktop experience, this container is capable of supporting accelerated rendering with /dev/dri mounted in, but the AMD HIP and Nvidia CUDA runtimes are massive which are not installed by default in this container.

Intel/ATI/AMD

To leverage hardware acceleration you will need to mount /dev/dri video device inside of the conainer.

--device /dev/dri:/dev/dri

We will automatically ensure the abc user inside of the container has the proper permissions to access this device.

Nvidia

Hardware acceleration users for Nvidia will need to install the container runtime provided by Nvidia on their host, instructions can be found here: https://github.com/NVIDIA/nvidia-docker

We automatically add the necessary environment variable that will utilise all the features available on a GPU on the host. Once nvidia-docker is installed on your host you will need to re/create the docker container with the nvidia container runtime --runtime=nvidia and add an environment variable -e NVIDIA_VISIBLE_DEVICES=all (can also be set to a specific gpu's UUID, this can be discovered by running nvidia-smi --query-gpu=gpu_name,gpu_uuid --format=csv ). NVIDIA automatically mounts the GPU and drivers from your host into the container.

Arm Devices

Arm devices can run this image, but generally should not mount in /dev/dri. The OpenGL ES version is not high enough to run Blender. The program can run on these platforms though, leveraging CPU LLVMPipe rendering.

Due to lack of arm64 binaries from the upstream project, our arm64 image installs the latest version from the ubuntu repo, which is usually behind and thus the version the image is tagged with does not match the version contained.

Options in all KasmVNC based GUI containers

This container is based on Docker Baseimage KasmVNC which means there are additional environment variables and run configurations to enable or disable specific functionality.

Optional environment variables

Variable Description
CUSTOM_PORT Internal port the container listens on for http if it needs to be swapped from the default 3000.
CUSTOM_HTTPS_PORT Internal port the container listens on for https if it needs to be swapped from the default 3001.
CUSTOM_USER HTTP Basic auth username, abc is default.
PASSWORD HTTP Basic auth password, abc is default. If unset there will be no auth
SUBFOLDER Subfolder for the application if running a subfolder reverse proxy, need both slashes IE /subfolder/
TITLE The page title displayed on the web browser, default "KasmVNC Client".
FM_HOME This is the home directory (landing) for the file manager, default "/config".
START_DOCKER If set to false a container with privilege will not automatically start the DinD Docker setup.
DRINODE If mounting in /dev/dri for DRI3 GPU Acceleration allows you to specify the device to use IE /dev/dri/renderD128
LC_ALL Set the Language for the container to run as IE fr_FR.UTF-8 ar_AE.UTF-8
NO_DECOR If set the application will run without window borders for use as a PWA.
NO_FULL Do not autmatically fullscreen applications when using openbox.

Optional run configurations

Variable Description
--privileged Will start a Docker in Docker (DinD) setup inside the container to use docker in an isolated environment. For increased performance mount the Docker directory inside the container to the host IE -v /home/user/docker-data:/var/lib/docker.
-v /var/run/docker.sock:/var/run/docker.sock Mount in the host level Docker socket to either interact with it via CLI or use Docker enabled applications.
--device /dev/dri:/dev/dri Mount a GPU into the container, this can be used in conjunction with the DRINODE environment variable to leverage a host video card for GPU accelerated appplications. Only Open Source drivers are supported IE (Intel,AMDGPU,Radeon,ATI,Nouveau)

Language Support - Internationalization

The environment variable LC_ALL can be used to start this image in a different language than English simply pass for example to launch the Desktop session in French LC_ALL=fr_FR.UTF-8. Some languages like Chinese, Japanese, or Korean will be missing fonts needed to render properly known as cjk fonts, but others may exist and not be installed. We only ensure fonts for Latin characters are present. Fonts can be installed with a mod on startup.

To install cjk fonts on startup as an example pass the environment variables:

-e DOCKER_MODS=linuxserver/mods:universal-package-install
-e INSTALL_PACKAGES=fonts-noto-cjk
-e LC_ALL=zh_CN.UTF-8

The web interface has the option for "IME Input Mode" in Settings which will allow non english characters to be used from a non en_US keyboard on the client. Once enabled it will perform the same as a local Linux installation set to your locale.

Lossless mode

This container is capable of delivering a true lossless image at a high framerate to your web browser by changing the Stream Quality preset to "Lossless", more information here. In order to use this mode from a non localhost endpoint the HTTPS port on 3001 needs to be used. If using a reverse proxy to port 3000 specific headers will need to be set as outlined here.

Usage

To help you get started creating a container from this image you can either use docker-compose or the docker cli.

docker-compose (recommended, click here for more info)

---
services:
  blender:
    image: lscr.io/linuxserver/blender:latest
    container_name: blender
    security_opt:
      - seccomp:unconfined #optional
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
      - SUBFOLDER=/ #optional
    volumes:
      - /path/to/config:/config
    ports:
      - 3000:3000
      - 3001:3001
    restart: unless-stopped
docker run -d \
  --name=blender \
  --security-opt seccomp=unconfined `#optional` \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=Etc/UTC \
  -e SUBFOLDER=/ `#optional` \
  -p 3000:3000 \
  -p 3001:3001 \
  -v /path/to/config:/config \
  --restart unless-stopped \
  lscr.io/linuxserver/blender:latest

Parameters

Containers are configured using parameters passed at runtime (such as those above). These parameters are separated by a colon and indicate <external>:<internal> respectively. For example, -p 8080:80 would expose port 80 from inside the container to be accessible from the host's IP on port 8080 outside the container.

Parameter Function
-p 3000 Blender desktop gui
-p 3001 Blender desktop gui HTTPS
-e PUID=1000 for UserID - see below for explanation
-e PGID=1000 for GroupID - see below for explanation
-e TZ=Etc/UTC specify a timezone to use, see this list.
-e SUBFOLDER=/ Specify a subfolder to use with reverse proxies, IE /subfolder/
-v /config Users home directory in the container, stores local files and settings
--security-opt seccomp=unconfined For Docker Engine only, this may be required depending on your Docker and storage configuration.

Environment variables from files (Docker secrets)

You can set any environment variable from a file by using a special prepend FILE__.

As an example:

-e FILE__MYVAR=/run/secrets/mysecretvariable

Will set the environment variable MYVAR based on the contents of the /run/secrets/mysecretvariable file.

Umask for running applications

For all of our images we provide the ability to override the default umask settings for services started within the containers using the optional -e UMASK=022 setting. Keep in mind umask is not chmod it subtracts from permissions based on it's value it does not add. Please read up here before asking for support.

User / Group Identifiers

When using volumes (-v flags), permissions issues can arise between the host OS and the container, we avoid this issue by allowing you to specify the user PUID and group PGID.

Ensure any volume directories on the host are owned by the same user you specify and any permissions issues will vanish like magic.

In this instance PUID=1000 and PGID=1000, to find yours use id your_user as below:

id your_user

Example output:

uid=1000(your_user) gid=1000(your_user) groups=1000(your_user)

Docker Mods

Docker Mods Docker Universal Mods

We publish various Docker Mods to enable additional functionality within the containers. The list of Mods available for this image (if any) as well as universal mods that can be applied to any one of our images can be accessed via the dynamic badges above.

Support Info

  • Shell access whilst the container is running:

    docker exec -it blender /bin/bash
  • To monitor the logs of the container in realtime:

    docker logs -f blender
  • Container version number:

    docker inspect -f '{{ index .Config.Labels "build_version" }}' blender
  • Image version number:

    docker inspect -f '{{ index .Config.Labels "build_version" }}' lscr.io/linuxserver/blender:latest

Updating Info

Most of our images are static, versioned, and require an image update and container recreation to update the app inside. With some exceptions (noted in the relevant readme.md), we do not recommend or support updating apps inside the container. Please consult the Application Setup section above to see if it is recommended for the image.

Below are the instructions for updating containers:

Via Docker Compose

  • Update images:

    • All images:

      docker-compose pull
    • Single image:

      docker-compose pull blender
  • Update containers:

    • All containers:

      docker-compose up -d
    • Single container:

      docker-compose up -d blender
  • You can also remove the old dangling images:

    docker image prune

Via Docker Run

  • Update the image:

    docker pull lscr.io/linuxserver/blender:latest
  • Stop the running container:

    docker stop blender
  • Delete the container:

    docker rm blender
  • Recreate a new container with the same docker run parameters as instructed above (if mapped correctly to a host folder, your /config folder and settings will be preserved)

  • You can also remove the old dangling images:

    docker image prune

Image Update Notifications - Diun (Docker Image Update Notifier)

tip: We recommend Diun for update notifications. Other tools that automatically update containers unattended are not recommended or supported.

Building locally

If you want to make local modifications to these images for development purposes or just to customize the logic:

git clone https://github.com/linuxserver/docker-blender.git
cd docker-blender
docker build \
  --no-cache \
  --pull \
  -t lscr.io/linuxserver/blender:latest .

The ARM variants can be built on x86_64 hardware using multiarch/qemu-user-static

docker run --rm --privileged multiarch/qemu-user-static:register --reset

Once registered you can define the dockerfile to use with -f Dockerfile.aarch64.

Versions

  • 10.02.24: - Update Readme with new env vars and ingest proper PWA icon.
  • 18.03.23: - Rebase to KasmVNC base image.
  • 13.12.22: - Rebase to Jammy, migrate to s6v3.
  • 06.05.22: - Use the full semver version in image tags. Arm32/64 version tags are inaccurate due to installing from ubuntu repo, which is usually behind.
  • 12.03.22: - Initial Release.

docker-blender's People

Contributors

aptalca avatar linuxserver-ci avatar thelamer avatar thespad avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-blender's Issues

Azure Container Instance Port Issue

Hi Team,
I can run the container in browser for my local host with 3000 port but when I tried to run it in Azure Container Instance with 3000 port enabled. It doesnt load with http://IP:3000
Azure Container Instance does not support port mapping. What could be other solution to run it over the cloud.

Thanks

[question] Viewport is unresponsive if bigger than full hd, Does 4k 60fps is achievable ?

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

The blender viewport is responsive at full hd resolution, but not in 4k on localhost,
I would like to understand if i miss-configured my launch parameters, or if it's a limitation of KASMvnc.
cuda , optix, work fine in the container.

My HOST hardware :

NVIDIA RTX 3060 Driver Version: 525.147.05 CUDA Version: 12.0

$ xdpyinfo | grep -i "DRI"
    DRI2
    DRI3

In the Container:
I am not sure if it's relevant, but i noticed xdpyinfo | grep -i "DRI" return nothing

Glx infos :

OpenGL vendor string: Mesa
OpenGL renderer string: zink Vulkan 1.3(llvmpipe (LLVM 15.0.7, 256 bits) (MESA_LLVMPIPE))
OpenGL core profile version string: 4.6 (Core Profile) Mesa 23.2.1-1ubuntu3.1~22.04.2
OpenGL core profile shading language version string: 4.60
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.6 (Compatibility Profile) Mesa 23.2.1-1ubuntu3.1~22.04.2
OpenGL shading language version string: 4.60
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 23.2.1-1ubuntu3.1~22.04.2
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:

Expected Behavior

No response

Steps To Reproduce

docker run -d \
  --name=blender \
  --gpus all \
  --security-opt seccomp=unconfined `#optional` \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=Etc/UTC \
  -e SUBFOLDER=/ `#optional` \
  -e NVIDIA_VISIBLE_DEVICES=all \
  -p 3000:3000 \
  -p 3001:3001 \
  -v /path/to/config:/config \
  --restart unless-stopped \
  --device=/dev/dri:/dev/dri lscr.io/linuxserver/blender:latest

Environment

- OS:  debian 12, Linux x99 6.1.0-10-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.38-2 (2023-07-27) x86_64 GNU/Linux
- How docker service was installed: via apt

CPU architecture

x86-64

Docker creation

$ docker run -d \
  --name=blender \
  --gpus all \
  --security-opt seccomp=unconfined `#optional` \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=Etc/UTC \
  -e SUBFOLDER=/ `#optional` \
  -e NVIDIA_VISIBLE_DEVICES=all \
  -p 3000:3000 \
  -p 3001:3001 \
  -v /path/to/config:/config \
  --restart unless-stopped \
  --device=/dev/dri:/dev/dri lscr.io/linuxserver/blender:latest

Container logs

$ docker logs blender
[migrations] started
[migrations] no migrations found
───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    1000
User GID:    1000
───────────────────────────────────────

**** adding /dev/dri/renderD128 to video group ssl-cert with id 105 ****
**** adding /dev/dri/card0 to video group video with id 44 ****
[custom-init] No custom files found, skipping...
/usr/bin/nvidia-smi
/usr/bin/nvidia-smi
_XSERVTransmkdir: ERROR: euid != 0,directory /tmp/.X11-unix will not be created.

Xvnc KasmVNC 1.2.0 - built May 25 2024 18:57:36
Copyright (C) 1999-2018 KasmVNC Team and many others (see README.me)
See http://kasmweb.com for information on KasmVNC.
Underlying X server release 12014000, The X.Org Foundation

[ls.io-init] done.
Obt-Message: Xinerama extension is not present on the server

[BUG] Blender does not start with container

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I just updated the container image to the latest tag (currently 4.1.1), and blender does not launch. It appears to be something to do with X trying to use MESA and zink?

When accessing the web server, KasmVNC loads fine, but I just get a black screen. Running ps in the container shows that blender is not launched. However, if I launch blender manually within the container, then it shows up in my web browser.

Expected Behavior

Blender should start with the container.

Steps To Reproduce

I have an NVIDIA GPU and am running with docker compose, using the nvidia-container-runtime. I also extend the base image by installing nvidia-cuda-toolkit. This has worked fine for several months, allowing me to render on my RTX 3070 graphics card.

However, since updating to the latest image, version 4.1.1, bringing up the container won't bring up blender...

I found that I can fix the behaviour by first installing python3-xdg and then editing /defaults/startwm.sh and commenting out the environment variables which are being set. I then searched for what commit and what repository added these environment variables to startwm.sh...

So, it was in the docker-baseimage-kasmvnc repository where these environment variables were added... However, on the same day that a commit added these environment variables (linuxserver/docker-baseimage-kasmvnc@421ff46), they were removed in a later commit (linuxserver/docker-baseimage-kasmvnc@c8a520d).

So, perhaps the bug should be reported there, but the thing is, they've already fixed it... Just maybe not in a release? I've not quite figured that part out, but either way, please can you update your latest release to include that commit?

Environment

- OS: Arch Linux, with `nvidia-open-dkms` drivers.
- How docker service was installed: pacman -S docker docker-compose

CPU architecture

x86-64

Docker creation

`docker compose up -d`

My compose.yaml:-


services:                                                                                                                                                                                                             
  blender:                                                                                                                                                                                                            
    image: local/blender:latest                                                                                                                                                                                       
    build:                                                                                                                                                                                                            
      context: .                                                                                                                                                                                                      
      dockerfile_inline: |                                                                                                                                                                                            
        FROM linuxserver/blender:latest                                                                                                                                                                               
        RUN apt-get update && \                                                                                                                                                                                       
          apt-get install --no-install-recommends -y nvidia-cuda-toolkit python3-xdg && \                                                                                                                             
          rm -rf /var/lib/apt/lists/*                                                                                                                                                                                 
                                                                                                                                                                                                                      
      tags:                                                                                                                                                                                                           
        - local/blender:latest                                                                                                                                                                                        
                                                                                                                                                                                                                      
    restart: unless-stopped                                                                                                                                                                                           
    container_name: blender                                                                                                                                                                                           
    environment:                                                                                                                                                                                                      
      - NVIDIA_VISIBLE_DEVICES=all                                                                                                                                                                                    
      # Run as the host vglusers group (1003)                                                                                                                                                                         
      - PGID=1003                                                                                                                                                                                                     
                                                                                                                                                                                                                      
    runtime: nvidia                                                                                                                                                                                                   
                                                                                                                                                                                                                      
    volumes:                                                                                                                                                                                                          
      # Pass-through support for nvidia GPU                                                                                                                                                                           
      - "/dev/nvidia0:/dev/nvidia0"                                                                                                                                                                                   
      - "/dev/nvidiactl:/dev/nvidiactl"                                                                                                                                                                               
      - "/dev/nvidia-modeset:/dev/nvidia-modeset"                                                                                                                                                                     
      - "/dev/nvidia-uvm:/dev/nvidia-uvm"                                                                                                                                                                             
      - "/dev/nvidia-uvm-tools:/dev/nvidia-uvm-tools"                                                                                                                                                                 
                                                                                                                                                                                                                      
      # For passing through host X11 server. Does it help?                                                                                                                                                            
      - /tmp/.X11-unix:/tmp/.X11-unix                                                                                                                                                                                 
                                                                                                                                                                                                                      
      - /media/data/blender-config:/config                                                                                                                                                                            
      - /media/data/blender-cache:/var/cache/blender                                                                                                                                                                  
                                                                                                                                                                                                                      
    # Add all the GPU capabilities                                                                                                                                                                                    
    deploy:                                                                                                                                                                                                           
      resources:                                                                                                                                                                                                      
        reservations:                                                                                                                                                                                                 
          devices:                                                                                                                                                                                                    
          - driver: nvidia                                                                                                                                                                                            
            count: all                                                                                                                                                                                                
            capabilities: [gpu, compute, utility, graphics]

Container logs

The container logs show the following:


blender  | ───────────────────────────────────────                                                                                                                                                                    
blender  |                                                                                                                                                                                                            
blender  |       ██╗     ███████╗██╗ ██████╗                                                                                                                                                                          
blender  |       ██║     ██╔════╝██║██╔═══██╗                                                                                                                                                                         
blender  |       ██║     ███████╗██║██║   ██║                                                                                                                                                                         
blender  |       ██║     ╚════██║██║██║   ██║                                                                                                                                                                         
blender  |       ███████╗███████║██║╚██████╔╝                                                                                                                                                                         
blender  |       ╚══════╝╚══════╝╚═╝ ╚═════╝                                                                                                                                                                          
blender  |                                                                                                                                                                                                            
blender  |    Brought to you by linuxserver.io                                                                                                                                                                        
blender  | ───────────────────────────────────────                                                                                                                                                                    
blender  |                                                                                                                                                                                                            
blender  | To support LSIO projects visit:                                                                                                                                                                            
blender  | https://www.linuxserver.io/donate/                                                                                                                                                                         
blender  |                                                                                                                                                                                                            
blender  | ───────────────────────────────────────                                                                                                                                                                    
blender  | GID/UID                                                                                                                                                                                                    
blender  | ───────────────────────────────────────                                                                                                                                                                    
blender  |                                                                                                                                                                                                            
blender  | User UID:    911                                                                                                                                                                                           
blender  | User GID:    1003                                                                                                                                                                                          
blender  | ───────────────────────────────────────                                                                                                                                                                    
blender  |                                                                                                                                                                                                            
blender  | **** permissions for /dev/dri/card1 are good ****                                                                                                                                                          
blender  | **** permissions for /dev/dri/renderD128 are good ****                                                                                                                                                     
blender  | [custom-init] No custom files found, skipping...
blender  | /usr/bin/nvidia-smi
blender  | /usr/bin/nvidia-smi
blender  | 
blender  | Xvnc KasmVNC 1.2.0 - built May 23 2024 00:22:09
blender  | Copyright (C) 1999-2018 KasmVNC Team and many others (see README.me)
blender  | See http://kasmweb.com for information on KasmVNC.
blender  | Underlying X server release 12014000, The X.Org Foundation
blender  | 
blender  | [ls.io-init] done.
blender  | Obt-Message: Xinerama extension is not present on the server
blender  | MESA: error: zink: could not create swapchain
blender  | X Error of failed request:  GLXBadCurrentWindow
blender  |   Major opcode of failed request:  149 (GLX)
blender  |   Minor opcode of failed request:  11 (X_GLXSwapBuffers)
blender  |   Serial number of failed request:  175
blender  |   Current serial number in output stream:  175
blender  | Read prefs: "/config/.config/blender/4.1/config/userpref.blend"

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.