[Python] Dockerfile code not working as expectation

Discussão em 'Python' iniciado por Stack, Março 13, 2025.

  1. Stack

    Stack Membro Participativo

    I have 2 Dockerfile code, this one is working:

    FROM ubuntu:22.04
    RUN apt update && apt install -y blender xvfb
    WORKDIR /workspace
    COPY script.py /workspace/script.py
    CMD ["blender", "--background", "--python", "/workspace/script.py"]


    But I don't know why it isn't working:

    FROM ubuntu:22.04

    RUN apt update && apt install -y \
    blender xvfb libgl1-mesa-glx libx11-xcb1 libxcb-dri3-0 libxcb-dri2-0 \
    libxcb-glx0 libxcb-present0 libxrender1 libxrandr2 libxcursor1 \
    libxkbcommon0 libxi6 libxxf86vm1 libasound2 libpulse0 \
    libopenal1 libvulkan1 x11-utils sudo wget curl unzip xz-utils && \
    apt clean

    RUN wget https://mirror.clarkson.edu/blender/release/Blender3.6/blender-3.6.5-linux-x64.tar.xz && \
    tar -xvf blender-3.6.5-linux-x64.tar.xz && \
    mv blender-3.6.5-linux-x64 /opt/blender && \
    ln -s /opt/blender/blender /usr/local/bin/blender

    WORKDIR /workspace

    COPY script.py /workspace/script.py

    CMD ["xvfb-run", "--auto-servernum", "--server-args=-screen 0 1920x1080x24", "blender", "--background", "--python", "/workspace/script.py"]


    I tried to find the cause, but I didn't get. The second code is modified version of first one. I expected it to be running.

    Continue reading...

Compartilhe esta Página