Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change to use alpine linux, much small base image size. #1

Open
wants to merge 2 commits into
base: alpine
Choose a base branch
from

Conversation

jamesmstone
Copy link

  • Change Maintainer to Label as Maintainer is being deprecated &
    add myself as a maintainer
  • Run through dockfmt

@ikester
Copy link
Owner

ikester commented Oct 30, 2016

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!

@jamesmstone jamesmstone changed the base branch from master to alpine October 31, 2016 02:15
@jamesmstone
Copy link
Author

Hey made those changes! but not sure, from security point of view, if separating the dependencies from the blender install is ideal.

@jamesmstone
Copy link
Author

jamesmstone commented Oct 31, 2016

Also being way too pedantic can we change ENV to ARG. Sorry ! :P

@jamesmstone
Copy link
Author

Ohh and I think the images is missing. Some dependencies, such as python

@ikester
Copy link
Owner

ikester commented Oct 31, 2016

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?

Change to use alpine linux, much small base image size.
 + Change Maintainer to Label http://stackoverflow.com/a/39767934/1432051
 + run through dockfmt https://github.com/jessfraz/dockfmt

Split up build so dependencies can be cached.
However not sure if this is ideal from a security perspective.
@jamesmstone
Copy link
Author

jamesmstone commented Oct 31, 2016

Hi again,
Sorry for the confusion.

Latest Version:

You're right, hadn't noticed your changes, have now rebased. 😄

ENV -> ARG:

From my understanding

  • ENV sets the environment variable in the container, forever.
  • ARG however, 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

@ikester
Copy link
Owner

ikester commented Nov 1, 2016

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?

@jamesmstone
Copy link
Author

Done!
however still need to sort out dependencies.

@ikester
Copy link
Owner

ikester commented Nov 1, 2016

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

Repository owner deleted a comment Aug 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants