From 76d10783827b4497f06e955c0c7c961b232d9935 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Behmo?= Date: Thu, 16 Apr 2020 19:22:12 +0200 Subject: [PATCH] Make it possible to pull nodejs packages from custom npm registry During an incident at npmjs.org it was extremely difficult to pull nodejs packages -- so we made it possible to pull from a custom registry, deployed for instance with Verdaccio (https://verdaccio.org/). --- CHANGELOG.md | 4 ++++ docs/configuration.rst | 14 ++++++++++++++ tutor/templates/build/openedx/Dockerfile | 3 ++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5673bfa..b693fa4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ Note: Breaking changes between versions are indicated by "💥". +## Unreleased + +- [Improvement] Make it possible to rely on a different npm registry for faster image building + ## v3.11.11 (2020-04-15) - [Bugfix] Make sure all emails (including "password reset") are properly saved to a local file in development mode (#315) diff --git a/docs/configuration.rst b/docs/configuration.rst index f306b75..d6ecb84 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -197,6 +197,20 @@ The following sections describe how to modify various aspects of the docker imag The custom image will be used the next time you run ``tutor local quickstart`` or ``tutor local start``. Do not attempt to run ``tutor local restart``! Restarting will not pick up the new image and will continue to use the old image. +openedx Docker Image build arguments +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +When building the "openedx" Docker image, it is possible to specify a few `arguments `__: + +- ``EDX_PLATFORM_REPOSITORY`` (default: ``"https://github.com/edx/edx-platform.git"``) +- ``EDX_PLATFORM_VERSION`` (default: ``"open-release/ironwood.master"``) +- ``EDX_PLATFORM_VERSION_DATE`` (default: ``"20200227"``) +- ``NPM_REGISTRY`` (default: ``"https://registry.npmjs.org/"``) + +These arguments can be specified from the command line, `very much like Docker `__. For instance:: + + tutor images build -a EDX_PLATFORM_VERSION=customsha1 openedx + Adding custom themes ~~~~~~~~~~~~~~~~~~~~ diff --git a/tutor/templates/build/openedx/Dockerfile b/tutor/templates/build/openedx/Dockerfile index 6c94d77..0b92b97 100644 --- a/tutor/templates/build/openedx/Dockerfile +++ b/tutor/templates/build/openedx/Dockerfile @@ -63,8 +63,9 @@ RUN nodeenv /openedx/nodeenv --node=8.9.3 --prebuilt ENV PATH /openedx/nodeenv/bin:${PATH} # Install nodejs requirements +ARG NPM_REGISTRY=https://registry.npmjs.org/ RUN npm set progress=false \ - && npm install + && npm install --verbose --registry=$NPM_REGISTRY ENV PATH ./node_modules/.bin:${PATH} # Install private requirements: this is useful for installing custom xblocks.