From 2affd8d1408d22cda98fad9c51cd8c236234ab7b Mon Sep 17 00:00:00 2001 From: Andrew Hosgood Date: Mon, 22 Jun 2026 19:59:25 +0100 Subject: [PATCH 1/2] Add exception for @nationalarchives/* to npm cooldown settings --- CHANGELOG.md | 4 +++- docker/tna-python/bin/tna-nvm | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f4c35f8..d178e03 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed ### Security +- Added exception for `@nationalarchives/*` from the npm cooldown + ## [1.16.0](https://github.com/nationalarchives/docker/compare/v1.15.0...v1.16.0) - 2026-06-22 ### Added @@ -31,7 +33,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Security -- Added exceptions for `tna-frontend-jinja` and `tna-utilities` from the 7 day cooldown for Poetry and `@nationalarchives/eslint-config` and `@nationalarchives/stylelint-config` for npm +- Added exceptions for `tna-frontend-jinja` and `tna-utilities` from the 7 day cooldown for Poetry ## [1.15.0](https://github.com/nationalarchives/docker/compare/v1.14.0...v1.15.0) - 2026-06-04 diff --git a/docker/tna-python/bin/tna-nvm b/docker/tna-python/bin/tna-nvm index 838d1e0..3c7742f 100755 --- a/docker/tna-python/bin/tna-nvm +++ b/docker/tna-python/bin/tna-nvm @@ -10,6 +10,7 @@ then nvm install "$NVM_NODE_VERSION" nvm use "$NVM_NODE_VERSION" --silent npm config set min-release-age="$COOLDOWN_PERIOD" --location=global + npm config set min-release-age-exclude="@nationalarchives/*" --location=global npm config set fund=false --location=global else nvm use default --silent From c41f8443e5e249d6a8401afbb5bbbb47f88147a9 Mon Sep 17 00:00:00 2001 From: Andrew Hosgood Date: Thu, 9 Jul 2026 17:10:23 +0100 Subject: [PATCH 2/2] Update Dockerfile to set NPM_VERSION and install specific npm version --- CHANGELOG.md | 1 + docker/tna-python/Dockerfile | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 015dffa..46eb8b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Security - Added exception for `@nationalarchives/*` from the npm cooldown +- Fixed npm version with `NPM_VERSION` environment variable ## [1.17.0](https://github.com/nationalarchives/docker/compare/v1.16.0...v1.17.0) - 2026-06-29 diff --git a/docker/tna-python/Dockerfile b/docker/tna-python/Dockerfile index 39e591c..d6b5646 100644 --- a/docker/tna-python/Dockerfile +++ b/docker/tna-python/Dockerfile @@ -73,6 +73,7 @@ ENV PIP_NO_CACHE_DIR=true \ # > docs.docker.com/build/building/variables # ========================================== ENV NODEJS_VERSION=24.17.0 \ + NPM_VERSION=12.0.0 \ PIP_VERSION=26.1 \ POETRY_VERSION=2.4.1 \ NVM_VERSION=0.40.5 \ @@ -86,6 +87,7 @@ ENV NODEJS_VERSION=24.17.0 \ # ========================================== LABEL uk.gov.nationalarchives.python-version="$PYTHON_VERSION" LABEL uk.gov.nationalarchives.nodejs-version="$NODEJS_VERSION" +LABEL uk.gov.nationalarchives.npm-version="$NPM_VERSION" LABEL uk.gov.nationalarchives.pip-version="$PIP_VERSION" LABEL uk.gov.nationalarchives.poetry-version="$POETRY_VERSION" LABEL uk.gov.nationalarchives.nvm-version="$NVM_VERSION" @@ -204,14 +206,16 @@ ENV PATH="$POETRY_HOME/bin:$PATH" USER app # ========================================== -# Install Node.js using nvm using the latest -# npm version and set it as the default +# Install Node.js with nvm using the version +# we specified, set it as the default one to +# use, and then update npm # ========================================== # hadolint ignore=SC1091 RUN . "$NVM_DIR/nvm.sh"; \ - nvm install --latest-npm "$NODEJS_VERSION"; \ + nvm install "$NODEJS_VERSION"; \ nvm alias default "$NODEJS_VERSION"; \ - nvm use default + nvm use default; \ + npm install -g npm@"$NPM_VERSION" # ========================================== # Create a directory for our SSL certificate