mirror of
https://github.com/jupyter/docker-stacks.git
synced 2025-10-18 15:32:56 +00:00
Make the base & minimal notebook containers not amd specific (e.g. support 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 a8d9c468a7d35dbda33ae902cc524db599519d8a. * 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
This commit is contained in:
@@ -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.
|
||||
|
@@ -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"
|
||||
@@ -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)
|
||||
@@ -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
|
||||
|
@@ -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
|
||||
-----------------
|
||||
|
||||
|
Reference in New Issue
Block a user