blender-docker
blender-docker copied to clipboard
Change to use alpine linux, much small base image size.
- Change Maintainer to Label as Maintainer is being deprecated & add myself as a maintainer
- Run through dockfmt
Hi James. Thanks for submitting this! I've been thinking about having an -alpine version for a while but didn't have time to look into Blenders' compatibility with it.
I would like it to live in its own branch though, so people have a choice between the Ubuntu and Alpine options. Can you please rebase it and submit again against the "alpine" branch?
By the way, the reason I moved the ENV declarations below that RUN line is to take advantage of Docker's image layer cache, since I expect the Blender version to change more often than the Ubuntu dependencies. That way, you can generate Docker Images for multiple Blender versions without re-running apt-get every time.
Thanks again!
Hey made those changes! but not sure, from security point of view, if separating the dependencies from the blender install is ideal.
Also being way too pedantic can we change ENV to ARG. Sorry ! :P
Ohh and I think the images is missing. Some dependencies, such as python
Hi James. Based on the diff, I don't think you rebased from the latest version of the alpine branch.
Also, I'm not sure what you mean by changing ENV to ARG. Where? And the missing dependencies? In the Ubuntu branch?
Hi again, Sorry for the confusion.
Latest Version:
You're right, hadn't noticed your changes, have now rebased. :smile:
ENV -> ARG:
From my understanding
ENVsets the environment variable in the container, forever.ARGhowever, sets (a default) environment variable in the container, that only exists during the build.
The other advantage of this is as it's only a default it can be overridden during build time using the --build-arg <varname>=<value> param.
So we could have something like
ARG BLENDER_MAJOR 2.78
ARG BLENDER_VERSION 2.78a
ARG BLENDER_BZ2_URL http://ftp.halifax.rwth-aachen.de/blender/release/Blender$BLENDER_MAJOR/blender-$BLENDER_VERSION-linux-glibc211-x86_64.tar.bz2
but when a new version comes out for local builds you could just run docker build -t blender --build-arg BLENDER_MAJOR=2.9 . and it would build!
However: this is really a separate thing, and could also be changed in the Ubuntu build.
Dependencies:
When I built the container for the first time I forgot about the packages that blender needs that come in Ubuntu by default, but not in Alpine
one such is python 3.5 which in Alpine is nicely named python3 but I assume there are more.
I just found matches for all the packages you installed in Ubuntu
Hi James. Thanks for the detailed explanation. This looks great. I'll look into the ENV vs. ARG distinction some more, but I'm pretty sure that the ENV instruction sets the environment variable only for subsequent Dockerfile instructions during build and don't affect a running container. The ARG instruction seems to be intended for Dockerfiles that are required to pass an argument at build time.
I just one to suggest one tiny change:
According to the documentation (Dockerfile reference), the LABEL instruction expects a key/value pair separated by an equals sign ('='). Can you make that simple change and resubmit?
Done! however still need to sort out dependencies.
James, I built an image with your latest PR and I'm not able to run blender in it. I'm guessing this is what you mean by sorting out dependencies. The following output of the loader for missing shared libraries and other problems should be helpful in tracking down missing libraries. Please rebase and resubmit once you get it working. Thanks!
# ldd /usr/local/blender/blender
/lib64/ld-linux-x86-64.so.2 (0x556a0f026000)
librt.so.1 => /lib64/ld-linux-x86-64.so.2 (0x556a0f026000)
libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x7fd887ef7000)
libpthread.so.0 => /lib64/ld-linux-x86-64.so.2 (0x556a0f026000)
Error loading shared library libGLU.so.1: No such file or directory (needed by /usr/local/blender/blender)
libGL.so.1 => /usr/lib/libGL.so.1 (0x7fd887c74000)
libX11.so.6 => /usr/lib/libX11.so.6 (0x7fd887951000)
libXi.so.6 => /usr/lib/libXi.so.6 (0x7fd887742000)
libXxf86vm.so.1 => /usr/lib/libXxf86vm.so.1 (0x7fd88753d000)
Error loading shared library libXrender.so.1: No such file or directory (needed by /usr/local/blender/blender)
libutil.so.1 => /lib64/ld-linux-x86-64.so.2 (0x556a0f026000)
libdl.so.2 => /lib64/ld-linux-x86-64.so.2 (0x556a0f026000)
libc.so.6 => /lib64/ld-linux-x86-64.so.2 (0x556a0f026000)
Error loading shared library ld-linux-x86-64.so.2: No such file or directory (needed by /usr/local/blender/blender)
libm.so.6 => /lib64/ld-linux-x86-64.so.2 (0x556a0f026000)
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x7fd88732a000)
libz.so.1 => /lib/libz.so.1 (0x7fd887114000)
libpng16.so.16 => /usr/lib/libpng16.so.16 (0x7fd886ee7000)
libexpat.so.1 => /usr/lib/libexpat.so.1 (0x7fd886cc7000)
libxcb-dri3.so.0 => /usr/lib/libxcb-dri3.so.0 (0x7fd886ac4000)
libxcb-present.so.0 => /usr/lib/libxcb-present.so.0 (0x7fd8868c1000)
libxcb-randr.so.0 => /usr/lib/libxcb-randr.so.0 (0x7fd8866b3000)
libxcb-xfixes.so.0 => /usr/lib/libxcb-xfixes.so.0 (0x7fd8864ab000)
libxcb-render.so.0 => /usr/lib/libxcb-render.so.0 (0x7fd8862a1000)
libxcb-shape.so.0 => /usr/lib/libxcb-shape.so.0 (0x7fd88609d000)
libxcb-sync.so.1 => /usr/lib/libxcb-sync.so.1 (0x7fd885e97000)
libxshmfence.so.1 => /usr/lib/libxshmfence.so.1 (0x7fd885c94000)
libglapi.so.0 => /usr/lib/libglapi.so.0 (0x7fd885a39000)
libXext.so.6 => /usr/lib/libXext.so.6 (0x7fd885829000)
libXdamage.so.1 => /usr/lib/libXdamage.so.1 (0x7fd885626000)
libXfixes.so.3 => /usr/lib/libXfixes.so.3 (0x7fd885420000)
libX11-xcb.so.1 => /usr/lib/libX11-xcb.so.1 (0x7fd88521e000)
libxcb-glx.so.0 => /usr/lib/libxcb-glx.so.0 (0x7fd885006000)
libxcb-dri2.so.0 => /usr/lib/libxcb-dri2.so.0 (0x7fd884e01000)
libxcb.so.1 => /usr/lib/libxcb.so.1 (0x7fd884be1000)
libdrm.so.2 => /usr/lib/libdrm.so.2 (0x7fd8849d3000)
libXau.so.6 => /usr/lib/libXau.so.6 (0x7fd8847d0000)
libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x7fd8845ca000)
Error relocating /usr/local/blender/blender: gluNewQuadric: symbol not found
Error relocating /usr/local/blender/blender: gluUnProject: symbol not found
Error relocating /usr/local/blender/blender: gluQuadricNormals: symbol not found
Error relocating /usr/local/blender/blender: __isnan: symbol not found
Error relocating /usr/local/blender/blender: __sched_cpualloc: symbol not found
Error relocating /usr/local/blender/blender: gluCylinder: symbol not found
Error relocating /usr/local/blender/blender: gluPerspective: symbol not found
Error relocating /usr/local/blender/blender: gluPickMatrix: symbol not found
Error relocating /usr/local/blender/blender: gluSphere: symbol not found
Error relocating /usr/local/blender/blender: __sched_cpufree: symbol not found
Error relocating /usr/local/blender/blender: gluQuadricOrientation: symbol not found
Error relocating /usr/local/blender/blender: __isnanf: symbol not found
Error relocating /usr/local/blender/blender: malloc_stats: symbol not found
Error relocating /usr/local/blender/blender: gluOrtho2D: symbol not found
Error relocating /usr/local/blender/blender: qsort_r: symbol not found
Error relocating /usr/local/blender/blender: __isinff: symbol not found
Error relocating /usr/local/blender/blender: feenableexcept: symbol not found
Error relocating /usr/local/blender/blender: gluQuadricDrawStyle: symbol not found
Error relocating /usr/local/blender/blender: gluDeleteQuadric: symbol not found
Error relocating /usr/local/blender/blender: __finite: symbol not found
Error relocating /usr/local/blender/blender: gluLookAt: symbol not found
Error relocating /usr/local/blender/blender: gluProject: symbol not found
Error relocating /usr/local/blender/blender: mallinfo: symbol not found
Error relocating /usr/local/blender/blender: pthread_attr_setaffinity_np: symbol not found
Error relocating /usr/local/blender/blender: backtrace: symbol not found
Error relocating /usr/local/blender/blender: __finitef: symbol not found
Error relocating /usr/local/blender/blender: gluDisk: symbol not found
Error relocating /usr/local/blender/blender: __isinf: symbol not found
Error relocating /usr/local/blender/blender: backtrace_symbols: symbol not found
Error relocating /usr/local/blender/blender: __rawmemchr: symbol not found
Error relocating /usr/local/blender/blender: __register_atfork: symbol not found
Error relocating /usr/local/blender/blender: XRenderFindVisualFormat: symbol not found