Change the root container in Jupyter Stacks

Hello,

For compatibility reasons, I need to change the very very base container upon which all the other docker stacks are built on. I found this in the base image docker file:

If I now build up on top of that (let’s say I want my own image to base off of the data science notebook), shouldn’t I just need to set that before the FROM part of my docker file?

ARG ROOT_CONTAINER=centos:centos7
ARG OWNER=jupyter
ARG BASE_CONTAINER=$OWNER/datascience-notebook
FROM $BASE_CONTAINER

That doesn’t seem to work. Do I need a second FROM? Or is this more time consuming than I imagined?

Of course, changing to centos instead of ubuntu will require a bunch of modifications for apt-get vs yum.

Dockerfiles are only interpreted at build time, and they result in a built container which is often pushed to a container registry. For example, you can create a container using tools that don’t require a Dockerfile.

FROM refers to one of these built containers not the Dockerfile. ARG statements only affect your current Dockerfile.

To do what you want you’ll need to clone the docker-stacks repo and rebuild the image(s) yourself passing your build args, though as you’ve already realised it won’t be easy to switch to centos.

If anyone ever needs centos7-based Jupyter Docker stacks, I have these available now:

Indeed there was some hacking involved to translate the Ubuntu base to CentOS base; but the notebooks seem to work in exactly the same way as before. They can be run both in Docker and ( perhaps more suited to HPC) Singularity

1 Like