Skip to content

Commit

Permalink
Remove redundant Blender Dockerfile and specify version through build…
Browse files Browse the repository at this point in the history
… args
  • Loading branch information
QcFe authored and giorio94 committed Apr 27, 2021
1 parent c0f4ed0 commit 797e115
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 78 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,10 @@ jobs:
- component: blender
context: ./provisioning/containers/blender
- component: blender-lts
context: ./provisioning/containers/blender-lts
context: ./provisioning/containers/blender
build-args: |
BLENDER_VERSION_MAJOR=2.83
BLENDER_VERSION_MINOR=13
# SSH bastion
- component: ssh-bastion
Expand Down
75 changes: 0 additions & 75 deletions provisioning/containers/blender-lts/Dockerfile

This file was deleted.

56 changes: 54 additions & 2 deletions provisioning/containers/blender/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,57 @@
# Start from https://github.com/nytimes/rd-blender-docker
FROM nytimes/blender:2.92-cpu-ubuntu18.04
# Original Dockerfile from https://github.com/nytimes/rd-blender-docker/blob/master/dist/2.92-cpu-ubuntu18.04/Dockerfile
# Includes edits to update to the latest LTS version

# ! With 18.04 there are issues with blender > 2.83.8
FROM ubuntu:20.04

# Enviorment variables
ENV DEBIAN_FRONTEND noninteractive
ENV LC_ALL C.UTF-8
ENV LANG C.UTF-8

# Install dependencies
RUN apt-get update && apt-get install -y \
wget \
libopenexr-dev \
bzip2 \
build-essential \
zlib1g-dev \
libxmu-dev \
libxi-dev \
libxxf86vm-dev \
libfontconfig1 \
libxrender1 \
libgl1-mesa-glx \
xz-utils \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*.*

ARG BLENDER_VERSION_MAJOR="2.92"
ARG BLENDER_VERSION_MINOR="0"
ENV BLENDER_VER="${BLENDER_VERSION_MAJOR}.${BLENDER_VERSION_MINOR}-linux64"
ENV PATH "$PATH:/bin/${BLENDER_VERSION_MAJOR}/python/bin/"
ENV BLENDER_PATH "/bin/${BLENDER_VERSION_MAJOR}"
ENV BLENDERPIP "/bin/${BLENDER_VERSION_MAJOR}/python/bin/pip3"
ENV BLENDERPY "/bin/${BLENDER_VERSION_MAJOR}/python/bin/python3.7m"

# Download and install Blender
RUN wget -q https://ftp.nluug.nl/pub/graphics/blender/release/Blender${BLENDER_VERSION_MAJOR}/blender-${BLENDER_VER}.tar.xz \
&& tar -xf blender-${BLENDER_VER}.tar.xz --strip-components=1 -C /bin \
&& rm -rf blender-${BLENDER_VER}.tar.xz \
&& rm -rf blender-${BLENDER_VER} \
&& rm -rf ${BLENDER_PATH}/python/lib/python3.7/site-packages/numpy

# Download the Python source since it is not bundled with Blender
# Also upgrades the the bulndled outdated version of numpy with a modern one
# Must first ensurepip to install Blender pip3 and then new numpy
RUN wget -q https://www.python.org/ftp/python/3.7.10/Python-3.7.10.tgz \
&& tar -xzf Python-3.7.10.tgz \
&& cp -r Python-3.7.10/Include/* $BLENDER_PATH/python/include/python3.7m/ \
&& rm -rf Python-3.7.10.tgz \
&& rm -rf Python-3.7.10 \
&& ${BLENDERPY} -m ensurepip \
&& ${BLENDERPIP} install --upgrade pip \
&& ${BLENDERPIP} install numpy

# Define user and user id default arguments
ARG USER=crownlabs
Expand Down

0 comments on commit 797e115

Please sign in to comment.