From 8eb98bce3c6dbb37fbf958d2153b37772b8f14a5 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Jul 2021 22:16:54 +0000 Subject: [PATCH 1/5] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - https://github.com/ambv/black → https://github.com/psf/black - [github.com/hadolint/hadolint.git: v2.5.0 → v2.6.0](https://github.com/hadolint/hadolint.git/compare/v2.5.0...v2.6.0) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7e0c098d..5b854aff 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,7 +4,7 @@ ci: repos: # Autoformat: Python code - - repo: https://github.com/ambv/black + - repo: https://github.com/psf/black rev: 21.6b0 hooks: - id: black @@ -18,7 +18,7 @@ repos: # Lint: Dockerfile - repo: https://github.com/hadolint/hadolint.git - rev: v2.5.0 + rev: v2.6.0 hooks: - id: hadolint-docker # FIXME: remove after https://github.com/hadolint/hadolint/issues/628 is resolved From d13be7a58fbdae9b0ea997ea073d32a18a837846 Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Tue, 6 Jul 2021 09:59:00 +0300 Subject: [PATCH 2/5] Update hadolint docker version --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5b854aff..7d1a0f43 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,7 +22,7 @@ repos: hooks: - id: hadolint-docker # FIXME: remove after https://github.com/hadolint/hadolint/issues/628 is resolved - entry: hadolint/hadolint:v2.5.0 hadolint + entry: hadolint/hadolint:v2.6.0 hadolint # Lint: YAML - repo: https://github.com/adrienverge/yamllint.git From 481bafbda7c3a81b16a1c64d813ad51412ac78aa Mon Sep 17 00:00:00 2001 From: Holden Karau Date: Thu, 8 Jul 2021 07:05:35 -0700 Subject: [PATCH 3/5] 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 --- README.md | 4 ++++ base-notebook/Dockerfile | 26 +++++++++++++------------- docs/index.rst | 5 +++++ 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index ac3b42ef..a023019a 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/base-notebook/Dockerfile b/base-notebook/Dockerfile index 88dc3eb7..3cd4379b 100644 --- a/base-notebook/Dockerfile +++ b/base-notebook/Dockerfile @@ -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 " 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 diff --git a/docs/index.rst b/docs/index.rst index 65119716..9b42b9ac 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -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 ----------------- From 6333762c56b66d69e3a8c16403f628d1d0c92875 Mon Sep 17 00:00:00 2001 From: mathbunnyru Date: Thu, 8 Jul 2021 14:06:16 +0000 Subject: [PATCH 4/5] [ci skip] Automated publish for 481bafbda7c3a81b16a1c64d813ad51412ac78aa --- docs/locale/en/LC_MESSAGES/index.po | 50 +++++++++++++++++------------ 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/docs/locale/en/LC_MESSAGES/index.po b/docs/locale/en/LC_MESSAGES/index.po index 97529148..4a534935 100644 --- a/docs/locale/en/LC_MESSAGES/index.po +++ b/docs/locale/en/LC_MESSAGES/index.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: docker-stacks latest\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-06-21 17:19+0000\n" +"POT-Creation-Date: 2021-07-08 14:06+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -19,44 +19,44 @@ msgstr "" "Generated-By: Babel 2.9.1\n" # 22f1bd46933144e092bf92e3af4c6f4f -#: ../../index.rst:50 206d746cbbe342cda0c4493ccb59abd6 +#: ../../index.rst:55 259addd8d90e4cbeab357be9823cac05 msgid "User Guide" msgstr "" # f35d75046f8c42ae8cab58d826154823 -#: ../../index.rst:60 31d02ffcf0e34bea8fc1baded2c08a47 +#: ../../index.rst:65 2479218777044cfdb444b6a7e9cd5971 msgid "Contributor Guide" msgstr "" # a737afe726cd49c4986d75b7d74eeed3 -#: ../../index.rst:73 80e7db5dc35640a6ba01b20d2cc3b20a +#: ../../index.rst:78 d089d107caef463c8e689748e60a47a7 msgid "Maintainer Guide" msgstr "" -#: ../../index.rst:79 +#: ../../index.rst:84 msgid "Issue Tracker on Github" msgstr "" -#: ../../index.rst:79 +#: ../../index.rst:84 msgid "Jupyter Discourse Forum" msgstr "" -#: ../../index.rst:79 +#: ../../index.rst:84 msgid "Jupyter Website" msgstr "" # 9cd216fa91ef40bbb957373faaf93732 -#: ../../index.rst:79 2ea0523f3631499382f7662f340c147b +#: ../../index.rst:84 7674c75edb8e4f02a4834ba9fe620933 msgid "Getting Help" msgstr "" # a0aa0bcd999c4c5e96cc57fd77780f96 -#: ../../index.rst:2 f1f51d536a99420abac00218cf41eb35 +#: ../../index.rst:2 a9c5366b811a4951b1a6d5edca0fea5c msgid "Jupyter Docker Stacks" msgstr "" # 5d06f458dc524214b2c97e865dd2dc81 -#: ../../index.rst:4 f38a09a8cf674ccc8fd29b525671a6ff +#: ../../index.rst:4 af64033317154bb69b9a295fe357741a msgid "" "Jupyter Docker Stacks are a set of ready-to-run Docker images containing " "Jupyter applications and interactive computing tools. You can use a stack" @@ -64,26 +64,26 @@ msgid "" msgstr "" # c69f151c806e4cdf9bebda05b06c760e -#: ../../index.rst:7 33ffc662a0874e708b34dc4ce9fced67 +#: ../../index.rst:7 b02d3a54f9434efabb9ec7cf44573954 msgid "Start a personal Jupyter Notebook server in a local Docker container" msgstr "" # b26271409ab743b2a349b3a8ca95233e -#: ../../index.rst:8 21a32796db4840a894fa7c604b3ae300 +#: ../../index.rst:8 657f4e715fe5481fb2c06edd5c6fa6b5 msgid "Run JupyterLab servers for a team using JupyterHub" msgstr "" # 4d60f4325fff4ffcad12703a4b9d6781 -#: ../../index.rst:9 0ca7e7c689564de0a575555277e82ade +#: ../../index.rst:9 faa40cd6f5694bbbaa1c71c8159b8811 msgid "Write your own project Dockerfile" msgstr "" # 78b0d31eb6e9462888eef92e6a84cdb7 -#: ../../index.rst:12 6389c5477bf942b7999d42b5e2e698ce +#: ../../index.rst:12 f0b4531077c34bf6bb2dc8b62b368cc9 msgid "Quick Start" msgstr "" -#: ../../index.rst:14 df6c516da7ed41cfad1e66f1a635484a +#: ../../index.rst:14 feff58d1445d4f96ab11966c9249526c msgid "" "You can try a `relatively recent build of the jupyter/base-notebook image" " on mybinder.org Date: Thu, 8 Jul 2021 17:21:14 +0300 Subject: [PATCH 5/5] Introduce owner to Dockerfiles to make it easy to test locally --- Makefile | 2 +- all-spark-notebook/Dockerfile | 3 ++- binder/Dockerfile | 3 ++- datascience-notebook/Dockerfile | 3 ++- minimal-notebook/Dockerfile | 3 ++- pyspark-notebook/Dockerfile | 3 ++- r-notebook/Dockerfile | 3 ++- scipy-notebook/Dockerfile | 3 ++- tensorflow-notebook/Dockerfile | 3 ++- 9 files changed, 17 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 35722294..5694b3a5 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,7 @@ help: build/%: DARGS?= build/%: ## build the latest image for a stack - docker build $(DARGS) --rm --force-rm -t $(OWNER)/$(notdir $@):latest ./$(notdir $@) + docker build $(DARGS) --rm --force-rm -t $(OWNER)/$(notdir $@):latest --build-arg OWNER=$(OWNER) ./$(notdir $@) @echo -n "Built image size: " @docker images $(OWNER)/$(notdir $@):latest --format "{{.Size}}" diff --git a/all-spark-notebook/Dockerfile b/all-spark-notebook/Dockerfile index 21b54bf5..26466863 100644 --- a/all-spark-notebook/Dockerfile +++ b/all-spark-notebook/Dockerfile @@ -1,6 +1,7 @@ # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. -ARG BASE_CONTAINER=jupyter/pyspark-notebook +ARG OWNER=jupyter +ARG BASE_CONTAINER=$OWNER/pyspark-notebook FROM $BASE_CONTAINER LABEL maintainer="Jupyter Project " diff --git a/binder/Dockerfile b/binder/Dockerfile index 75fb0c34..d9f4a013 100644 --- a/binder/Dockerfile +++ b/binder/Dockerfile @@ -2,7 +2,8 @@ # Distributed under the terms of the Modified BSD License. # https://hub.docker.com/r/jupyter/base-notebook/tags -ARG BASE_CONTAINER=jupyter/base-notebook:33add21fab64 +ARG OWNER=jupyter +ARG BASE_CONTAINER=$OWNER/base-notebook:33add21fab64 FROM $BASE_CONTAINER LABEL maintainer="Jupyter Project " diff --git a/datascience-notebook/Dockerfile b/datascience-notebook/Dockerfile index 61cb5711..c8d99e56 100644 --- a/datascience-notebook/Dockerfile +++ b/datascience-notebook/Dockerfile @@ -1,6 +1,7 @@ # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. -ARG BASE_CONTAINER=jupyter/scipy-notebook +ARG OWNER=jupyter +ARG BASE_CONTAINER=$OWNER/scipy-notebook FROM $BASE_CONTAINER LABEL maintainer="Jupyter Project " diff --git a/minimal-notebook/Dockerfile b/minimal-notebook/Dockerfile index 5f573bdc..3450e7ca 100644 --- a/minimal-notebook/Dockerfile +++ b/minimal-notebook/Dockerfile @@ -1,6 +1,7 @@ # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. -ARG BASE_CONTAINER=jupyter/base-notebook +ARG OWNER=jupyter +ARG BASE_CONTAINER=$OWNER/base-notebook FROM $BASE_CONTAINER LABEL maintainer="Jupyter Project " diff --git a/pyspark-notebook/Dockerfile b/pyspark-notebook/Dockerfile index 8dc2dcc4..c400a882 100644 --- a/pyspark-notebook/Dockerfile +++ b/pyspark-notebook/Dockerfile @@ -1,6 +1,7 @@ # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. -ARG BASE_CONTAINER=jupyter/scipy-notebook +ARG OWNER=jupyter +ARG BASE_CONTAINER=$OWNER/scipy-notebook FROM $BASE_CONTAINER LABEL maintainer="Jupyter Project " diff --git a/r-notebook/Dockerfile b/r-notebook/Dockerfile index 20053c47..5a098a4e 100644 --- a/r-notebook/Dockerfile +++ b/r-notebook/Dockerfile @@ -1,6 +1,7 @@ # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. -ARG BASE_CONTAINER=jupyter/minimal-notebook +ARG OWNER=jupyter +ARG BASE_CONTAINER=$OWNER/minimal-notebook FROM $BASE_CONTAINER LABEL maintainer="Jupyter Project " diff --git a/scipy-notebook/Dockerfile b/scipy-notebook/Dockerfile index c2b769eb..4f82be5b 100644 --- a/scipy-notebook/Dockerfile +++ b/scipy-notebook/Dockerfile @@ -1,6 +1,7 @@ # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. -ARG BASE_CONTAINER=jupyter/minimal-notebook +ARG OWNER=jupyter +ARG BASE_CONTAINER=$OWNER/minimal-notebook FROM $BASE_CONTAINER LABEL maintainer="Jupyter Project " diff --git a/tensorflow-notebook/Dockerfile b/tensorflow-notebook/Dockerfile index 3271de75..96b78ba1 100644 --- a/tensorflow-notebook/Dockerfile +++ b/tensorflow-notebook/Dockerfile @@ -1,6 +1,7 @@ # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. -ARG BASE_CONTAINER=jupyter/scipy-notebook +ARG OWNER=jupyter +ARG BASE_CONTAINER=$OWNER/scipy-notebook FROM $BASE_CONTAINER LABEL maintainer="Jupyter Project "