Skip to content

Commit

Permalink
Make the base & minimal notebook containers not amd specific (e.g. su…
Browse files Browse the repository at this point in the history
…pport building for arm64) (#1368)

* Dynamically select the right miniforge arch and unpin the ROOT_CONTAINER so that buildx can build arm64 and amd64

cleanup

* Remove the commented out hard set of arch

* Address code review comments from mathbunnyru

* Add setting the owner to respective dockerhbub username

* Revert "Add setting the owner to respective dockerhbub username"

This reverts commit a8d9c46.

* Fix up the dockerfile, make the default buildx compatible with the CI and add a comment about how to do cross-platform builds.

* Update the docs

* Refactor the Makefile to support cross-building images incrementally, add ARG OWNER to the Dockerfile's so people can more easily push to their own, add docker buildx & ARM64 support to the CI

* Simplify build-test-all rule

* Match patch version

* Run prettier on docker.yml

* Declare and export seperately per docker lint

* Skip CI changes

* Revert the makefile changes

* Update the Arch comment to match

* back out unrelated changes
  • Loading branch information
holdenk authored Jul 8, 2021
1 parent 015b0f8 commit 481bafb
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 13 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,7 @@ This change is tracked in the issue [#1217](https://github.com/jupyter/docker-st
- [Jupyter Discourse Forum](https://discourse.jupyter.org/)
- [Jupyter Website](https://jupyter.org)
- [Images on DockerHub](https://hub.docker.com/u/jupyter)

## Architectures

Currently published containers only support x86, some containers may support cross-building with docker buildx.
26 changes: 13 additions & 13 deletions base-notebook/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@

# Ubuntu 20.04 (focal)
# https://hub.docker.com/_/ubuntu/?tab=tags&name=focal
# OS/ARCH: linux/amd64
ARG ROOT_CONTAINER=ubuntu:focal-20210609@sha256:376209074d481dca0a9cf4282710cd30a9e7ff402dea8261acdaaf57a18971dd
ARG ROOT_CONTAINER=ubuntu:focal-20210609

ARG BASE_CONTAINER=$ROOT_CONTAINER
FROM $BASE_CONTAINER
FROM $ROOT_CONTAINER

LABEL maintainer="Jupyter Project <jupyter@googlegroups.com>"
ARG NB_USER="jovyan"
Expand All @@ -27,19 +25,13 @@ USER root
ARG conda_version="4.10.2"
# Miniforge installer patch version
ARG miniforge_patch_number="0"
# Miniforge installer architecture
ARG miniforge_arch="x86_64"
# Package Manager and Python implementation to use (https://github.com/conda-forge/miniforge)
# - conda only: either Miniforge3 to use Python or Miniforge-pypy3 to use PyPy
# - conda + mamba: either Mambaforge to use Python or Mambaforge-pypy3 to use PyPy
ARG miniforge_python="Mambaforge"

# Miniforge archive to install
ARG miniforge_version="${conda_version}-${miniforge_patch_number}"
# Miniforge installer
ARG miniforge_installer="${miniforge_python}-${miniforge_version}-Linux-${miniforge_arch}.sh"
# Miniforge checksum
ARG miniforge_checksum="1e89ee86afa06e23b2478579be16a33fff6cff346314f6a6382fd20b1f83e669"


# Install all OS dependencies for notebook server that starts but lacks all
# features (e.g., download as all possible file formats)
Expand Down Expand Up @@ -104,8 +96,16 @@ RUN mkdir "/home/${NB_USER}/work" && \
WORKDIR /tmp

# Prerequisites installation: conda, mamba, pip, tini
RUN wget --quiet "https://github.com/conda-forge/miniforge/releases/download/${miniforge_version}/${miniforge_installer}" && \
echo "${miniforge_checksum} *${miniforge_installer}" | sha256sum --check && \
RUN set -x && \
# Miniforge installer
miniforge_arch=$(uname -m) && \
export miniforge_arch && \
if [ "$miniforge_arch" == "aarm64" ]; then \
miniforge_arch="arm64"; \
fi; \
miniforge_installer="${miniforge_python}-${miniforge_version}-Linux-${miniforge_arch}.sh" && \
export miniforge_installer && \
wget --quiet "https://github.com/conda-forge/miniforge/releases/download/${miniforge_version}/${miniforge_installer}" && \
/bin/bash "${miniforge_installer}" -f -b -p "${CONDA_DIR}" && \
rm "${miniforge_installer}" && \
# Conda configuration see https://conda.io/projects/conda/en/latest/configuration.html
Expand Down
5 changes: 5 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ Docker destroys the container after notebook server exit, but any files written

docker run --rm -p 10000:8888 -e JUPYTER_ENABLE_LAB=yes -v "${PWD}":/home/jovyan/work jupyter/datascience-notebook:33add21fab64

Architectures
-----------
Currently published containers only support x86, some containers may support cross-building with docker buildx.


Table of Contents
-----------------

Expand Down

0 comments on commit 481bafb

Please sign in to comment.