From 0e0bfa78d31a50393eabfe3fff7e6be9cbfeac86 Mon Sep 17 00:00:00 2001 From: Morten Brekkevold <morten.brekkevold@sikt.no> Date: Fri, 1 Mar 2024 10:42:49 +0000 Subject: [PATCH 1/2] Install Node/NPM in docker dev environment We are working on replacing SASS compilation (and later JS bundling) with webpack, which will require Node and NPM. This change adds these tools to the Docker-based development environment so everything can be built there. --- Dockerfile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 27e0da28ee..b1272026fa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,7 +35,13 @@ RUN apt-get update && \ locales \ python3-dbg gdb \ sudo python3-dev python3-pip python3-virtualenv build-essential supervisor \ - debian-keyring debian-archive-keyring ca-certificates + debian-keyring debian-archive-keyring ca-certificates curl gpg + +## Use deb.nodesource.com to fetch more modern versions of Node/NPM than Debian can provide +RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /usr/share/keyrings/nodesource.gpg && \ + echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main' > /etc/apt/sources.list.d/nodesource.list && \ + apt-get update && \ + apt-get install -y nodejs ARG TIMEZONE=Europe/Oslo ARG LOCALE=en_US.UTF-8 From 950d5145e13dead66ed6a5f6d4381f7422a5decd Mon Sep 17 00:00:00 2001 From: Morten Brekkevold <morten.brekkevold@sikt.no> Date: Mon, 4 Mar 2024 10:45:05 +0000 Subject: [PATCH 2/2] Specify linux/amd64 as the docker build platform The deb.nodesource.com archives only publish NodeJS packages for the amd64 architecture. Attempting to build this Dockerfile on a Apple silicon Mac (aarch64 architecture) will result in an image that pulls the incorrect version of `nodejs` from deb.debian.org instead. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index b1272026fa..cf8d0fb79f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,7 +22,7 @@ # be world-readable! # # -FROM debian:bullseye +FROM --platform=linux/amd64 debian:bullseye #### Prepare the OS base setup ###