diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index e93dc5e5..99049208 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -10,7 +10,7 @@ "build": { "dockerfile": "../dockerfile" }, - "postCreateCommand": "git config --global --add safe.directory /workspaces/uk-controller-plugin", + "postCreateCommand": "git config --global --add safe.directory /workspaces/uk-controller-plugin && yarn install", "containerUser": "ubuntu", "remoteUser": "ubuntu" } diff --git a/dockerfile b/dockerfile index cd19f22b..4bd3999a 100644 --- a/dockerfile +++ b/dockerfile @@ -7,6 +7,7 @@ ARG XWIN_TRIPLE=x86_64-unknown-linux-musl ARG WINDOWS_CRT_VERSION=14.29.16.11 # Old known working = 10.0.20348 ARG WINDOWS_SDK_VERSION=10.0.26100 +ARG NODE_VERSION=24 ADD "https://github.com/Jake-Shadle/xwin/releases/download/${XWIN_VERSION}/xwin-${XWIN_VERSION}-${XWIN_TRIPLE}.tar.gz" \ /tmp/xwin.tar.gz @@ -134,6 +135,21 @@ ENV CURL_INCLUDEDIR=/opt/curl/include/ ENV CURL_LIBRARYDIR=/opt/curl/build/lib/ ENV CURL_DEBUG_LIBRARYDIR=/opt/curl/build/lib/ +# Node.js and Yarn (classic), used by semantic-release and to refresh yarn.lock. +RUN <<-EOF + set -eux + + export DEBIAN_FRONTEND=noninteractive + apt update + apt install -y --no-install-recommends curl ca-certificates gnupg + curl -fsSL "https://deb.nodesource.com/setup_${NODE_VERSION}.x" | bash - + apt install -y nodejs + npm install -g yarn@1.22.22 + apt autoremove -y + apt clean -y + rm -rf /var/lib/apt/lists/* +EOF + USER ubuntu CMD ["/bin/bash"] diff --git a/docs/CONTAINER_BUILD.md b/docs/CONTAINER_BUILD.md index d75906bb..02b656a0 100644 --- a/docs/CONTAINER_BUILD.md +++ b/docs/CONTAINER_BUILD.md @@ -67,3 +67,7 @@ that the line endings in the Dockerfile are LF, and are not converted to CRLF. By default, Git is not installed within the container. Git operations should be performed on the host machine, or Git installed in the container. + +The container includes Node.js 24 and Yarn 1.22.22, used by the release tooling +(`semantic-release`) and to refresh `yarn.lock`. In the Dev Container, `yarn +install` runs automatically after the container is created.