| FROM kasmweb/blender:1.18.0-rolling-daily |
|
|
| USER root |
|
|
| |
| |
| ENV HOME=/home/kasm-user \ |
| STARTUPDIR=/dockerstartup \ |
| VNC_PW=password \ |
| DISPLAY=:1 \ |
| WAYLAND_DISPLAY= \ |
| XDG_RUNTIME_DIR=/tmp/runtime-kasm \ |
| LIBGL_ALWAYS_SOFTWARE=1 \ |
| GALLIUM_DRIVER=llvmpipe \ |
| MESA_GL_VERSION_OVERRIDE=4.5 \ |
| MESA_GLSL_VERSION_OVERRIDE=450 |
|
|
| |
| RUN apt-get update && apt-get install -y \ |
| nginx \ |
| libgl1-mesa-dri \ |
| libgl1-mesa-glx \ |
| libglx-mesa0 \ |
| libegl-mesa0 \ |
| libgl1 \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| RUN BLENDER_BIN=$(readlink -f $(which blender)) && \ |
| echo "$BLENDER_BIN" > /tmp/blender_path.txt && \ |
| mv "$BLENDER_BIN" "${BLENDER_BIN}.real" |
|
|
| |
| RUN BLENDER_BIN=$(cat /tmp/blender_path.txt) && \ |
| cat > "$BLENDER_BIN" << 'EOF' |
| |
| export LIBGL_ALWAYS_SOFTWARE=1 |
| export GALLIUM_DRIVER=llvmpipe |
| export MESA_GL_VERSION_OVERRIDE=4.5 |
| export MESA_GLSL_VERSION_OVERRIDE=450 |
|
|
| |
| unset WAYLAND_DISPLAY |
|
|
| |
| SYSTEM_GL=$(ldconfig -p | grep libGL.so.1 | grep x86-64 | head -1 | awk '{print $NF}') |
| if [ -n "$SYSTEM_GL" ]; then |
| export LD_PRELOAD="$SYSTEM_GL${LD_PRELOAD:+:$LD_PRELOAD}" |
| fi |
|
|
| exec "${0}.real" "$@" |
| EOF |
|
|
| |
| RUN BLENDER_BIN=$(cat /tmp/blender_path.txt) && chmod +x "$BLENDER_BIN" |
|
|
| |
| RUN cat > /etc/nginx/nginx.conf << 'EOF' |
| worker_processes 1; |
| daemon off; |
| error_log /tmp/nginx_error.log; |
| pid /tmp/nginx.pid; |
|
|
| events { |
| worker_connections 1024; |
| } |
|
|
| http { |
| client_body_temp_path /tmp/client_body; |
| proxy_temp_path /tmp/proxy_temp; |
| fastcgi_temp_path /tmp/fastcgi_temp; |
| uwsgi_temp_path /tmp/uwsgi_temp; |
| scgi_temp_path /tmp/scgi_temp; |
|
|
| server { |
| listen 7860; |
| |
| location / { |
| |
| proxy_pass https://127.0.0.1:6901; |
| |
| |
| proxy_http_version 1.1; |
| proxy_set_header Upgrade $http_upgrade; |
| proxy_set_header Connection "upgrade"; |
| |
| proxy_set_header Host $host; |
| proxy_set_header X-Real-IP $remote_addr; |
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
| |
| |
| proxy_set_header Authorization "Basic a2FzbV91c2VyOnBhc3N3b3Jk"; |
| |
| proxy_read_timeout 1800s; |
| proxy_send_timeout 1800s; |
| proxy_connect_timeout 60s; |
| proxy_buffering off; |
| } |
| } |
| } |
| EOF |
|
|
| |
| RUN cat > /dockerstartup/hf_startup.sh << 'EOF' |
| |
| echo "Starting Nginx reverse proxy on port 7860..." |
| nginx -c /etc/nginx/nginx.conf & |
|
|
| echo "Handing off to KasmVNC..." |
| exec /dockerstartup/vnc_startup.sh /dockerstartup/kasm_startup.sh "$@" |
| EOF |
| RUN chmod +x /dockerstartup/hf_startup.sh |
|
|
| |
| RUN mkdir -p /tmp/runtime-kasm && \ |
| chmod 700 /tmp/runtime-kasm && \ |
| chown 1000:0 /tmp/runtime-kasm && \ |
| chown -R 1000:0 /etc/nginx /var/log/nginx /var/lib/nginx /dockerstartup/hf_startup.sh && \ |
| chmod -R 775 /etc/nginx /var/log/nginx /var/lib/nginx |
|
|
| |
| USER 1000 |
|
|
| |
| EXPOSE 7860 |
|
|
| |
| ENTRYPOINT ["/dockerstartup/hf_startup.sh"] |
| CMD ["--wait"] |